From b41eed10d6f28df14e4d931d3b9036ba95655970 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 31 Jul 2024 18:25:50 +0000 Subject: [PATCH 01/22] Add boilerplate for new sql parser --- components/core/CMakeLists.txt | 2 + components/core/src/clp_s/CMakeLists.txt | 1 + .../core/src/clp_s/search/sql/CMakeLists.txt | 28 ++++++++ components/core/src/clp_s/search/sql/Sql.g4 | 5 ++ components/core/src/clp_s/search/sql/sql.cpp | 72 +++++++++++++++++++ components/core/src/clp_s/search/sql/sql.hpp | 17 +++++ components/core/tests/test-sql.cpp | 27 +++++++ 7 files changed, 152 insertions(+) create mode 100644 components/core/src/clp_s/search/sql/CMakeLists.txt create mode 100644 components/core/src/clp_s/search/sql/Sql.g4 create mode 100644 components/core/src/clp_s/search/sql/sql.cpp create mode 100644 components/core/src/clp_s/search/sql/sql.hpp create mode 100644 components/core/tests/test-sql.cpp diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index 19c9151bf..2e998e588 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -479,6 +479,7 @@ set(SOURCE_FILES_unitTest tests/test-Stopwatch.cpp tests/test-StreamingCompression.cpp tests/test-string_utils.cpp + tests/test-sql.cpp tests/test-TimestampPattern.cpp tests/test-utf8_utils.cpp tests/test-Utils.cpp @@ -499,6 +500,7 @@ target_link_libraries(unitTest LibArchive::LibArchive MariaDBClient::MariaDBClient spdlog::spdlog + sql ${sqlite_LIBRARY_DEPENDENCIES} ${STD_FS_LIBS} clp::regex_utils diff --git a/components/core/src/clp_s/CMakeLists.txt b/components/core/src/clp_s/CMakeLists.txt index c8cf08b22..0b49a6bb8 100644 --- a/components/core/src/clp_s/CMakeLists.txt +++ b/components/core/src/clp_s/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(search/kql) +add_subdirectory(search/sql) set( CLP_SOURCES diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt new file mode 100644 index 000000000..af2a8ef81 --- /dev/null +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -0,0 +1,28 @@ +ANTLR_TARGET( + SqlParser + Sql.g4 + LEXER PARSER VISITOR + PACKAGE sql +) + +add_library( + sql + ../../Utils.hpp + ../AndExpr.hpp + ../BooleanLiteral.hpp + ../ColumnDescriptor.hpp + ../DateLiteral.hpp + ../EmptyExpr.hpp + ../Expression.hpp + ../FilterExpr.hpp + ../Integral.hpp + ../NullLiteral.hpp + ../OrExpr.hpp + ../StringLiteral.hpp + ${ANTLR_SqlParser_CXX_OUTPUTS} + sql.cpp + sql.hpp +) +target_compile_features(sql PRIVATE cxx_std_20) +target_include_directories(sql PRIVATE ${ANTLR_SqlParser_OUTPUT_DIR}) +target_link_libraries(sql PRIVATE antlr4_static Boost::filesystem) diff --git a/components/core/src/clp_s/search/sql/Sql.g4 b/components/core/src/clp_s/search/sql/Sql.g4 new file mode 100644 index 000000000..cabf3e068 --- /dev/null +++ b/components/core/src/clp_s/search/sql/Sql.g4 @@ -0,0 +1,5 @@ +grammar Sql; + +start: EOF ; + +SPACE: [ \t\r\n] -> skip ; diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp new file mode 100644 index 000000000..e3f1a866c --- /dev/null +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -0,0 +1,72 @@ +#include +#include + +#include +#include + +#include "SqlBaseVisitor.h" +#include "SqlLexer.h" +#include "SqlParser.h" + +#include "../EmptyExpr.hpp" + +using namespace antlr4; +using namespace sql; + +namespace clp_s::search::sql { +class ErrorListener : public BaseErrorListener { +public: + void syntaxError( + Recognizer* recognizer, + Token* offending_symbol, + size_t line, + size_t char_position_in_line, + std::string const& msg, + std::exception_ptr e + ) override { + m_error = true; + m_error_message = msg; + } + + bool error() const { return m_error; } + + std::string const& message() const { return m_error_message; } + +private: + bool m_error{false}; + std::string m_error_message; +}; + +class ParseTreeVisitor : public SqlBaseVisitor { +public: + std::any visitStart(SqlParser::StartContext* ctx) override { + return EmptyExpr::create(); + } +}; + +std::shared_ptr parse_sql_expression(std::istream& in) { + ErrorListener lexer_error_listener; + ErrorListener parser_error_listener; + + ANTLRInputStream input(in); + SqlLexer lexer(&input); + lexer.removeErrorListeners(); + lexer.addErrorListener(&lexer_error_listener); + CommonTokenStream tokens(&lexer); + SqlParser parser(&tokens); + parser.removeErrorListeners(); + parser.addErrorListener(&parser_error_listener); + SqlParser::StartContext* tree = parser.start(); + + if (lexer_error_listener.error()) { + SPDLOG_ERROR("Lexer error: {}", lexer_error_listener.message()); + return {}; + } else if (parser_error_listener.error()) { + SPDLOG_ERROR("Parser error: {}", parser_error_listener.message()); + return {}; + } + + ParseTreeVisitor visitor; + return std::any_cast>(visitor.visitStart(tree)); +} +} // namespace clp_s::search::sql diff --git a/components/core/src/clp_s/search/sql/sql.hpp b/components/core/src/clp_s/search/sql/sql.hpp new file mode 100644 index 000000000..84a5475ee --- /dev/null +++ b/components/core/src/clp_s/search/sql/sql.hpp @@ -0,0 +1,17 @@ +#ifndef CLP_S_SEARCH_SQL_SQL_HPP +#define CLP_S_SEARCH_SQL_SQL_HPP + +#include + +#include "../Expression.hpp" + +namespace clp_s::search::sql { +/** + * Generate a search AST from an SQL expression in an input stream + * @param in input stream containing an SQL expression followed by EOF + * @return a search AST on success, nullptr otherwise + */ +std::shared_ptr parse_sql_expression(std::istream& in); +} // namespace clp_s::search::kql + +#endif // CLP_S_SEARCH_SQL_SQL_HPP diff --git a/components/core/tests/test-sql.cpp b/components/core/tests/test-sql.cpp new file mode 100644 index 000000000..0ab47e42e --- /dev/null +++ b/components/core/tests/test-sql.cpp @@ -0,0 +1,27 @@ +#include +#include +#include + +#include +#include + +#include "../src/clp_s/search/EmptyExpr.hpp" +#include "../src/clp_s/search/sql/sql.hpp" +#include "LogSuppressor.hpp" + +using clp_s::search::EmptyExpr; +using clp_s::search::sql::parse_sql_expression; +using std::string; +using std::stringstream; +using std::vector; + +TEST_CASE("Test parsing SQL", "[SQL]") { + // Suppress logging + LogSuppressor suppressor{}; + + SECTION("Stub accepts empty string") { + stringstream empty_string{""}; + auto filter = std::dynamic_pointer_cast(parse_sql_expression(empty_string)); + REQUIRE(nullptr != filter); + } +} From 86acbf528fcfc453411919155f29e44bbd5f3b3f Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 31 Jul 2024 19:07:01 +0000 Subject: [PATCH 02/22] Fix lint --- components/core/src/clp_s/search/sql/sql.cpp | 7 ++----- components/core/src/clp_s/search/sql/sql.hpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index e3f1a866c..9ac3cba43 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -4,12 +4,11 @@ #include #include +#include "../EmptyExpr.hpp" #include "SqlBaseVisitor.h" #include "SqlLexer.h" #include "SqlParser.h" -#include "../EmptyExpr.hpp" - using namespace antlr4; using namespace sql; @@ -39,9 +38,7 @@ class ErrorListener : public BaseErrorListener { class ParseTreeVisitor : public SqlBaseVisitor { public: - std::any visitStart(SqlParser::StartContext* ctx) override { - return EmptyExpr::create(); - } + std::any visitStart(SqlParser::StartContext* ctx) override { return EmptyExpr::create(); } }; std::shared_ptr parse_sql_expression(std::istream& in) { diff --git a/components/core/src/clp_s/search/sql/sql.hpp b/components/core/src/clp_s/search/sql/sql.hpp index 84a5475ee..45f5d960b 100644 --- a/components/core/src/clp_s/search/sql/sql.hpp +++ b/components/core/src/clp_s/search/sql/sql.hpp @@ -12,6 +12,6 @@ namespace clp_s::search::sql { * @return a search AST on success, nullptr otherwise */ std::shared_ptr parse_sql_expression(std::istream& in); -} // namespace clp_s::search::kql +} // namespace clp_s::search::sql #endif // CLP_S_SEARCH_SQL_SQL_HPP From 93cb37c4e7708b2c9bf41eb607bf78c08775ba0f Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Thu, 1 Aug 2024 20:05:43 -0400 Subject: [PATCH 03/22] Apply suggestions from code review Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- components/core/src/clp_s/search/sql/sql.cpp | 4 +++- components/core/src/clp_s/search/sql/sql.hpp | 4 ++-- components/core/tests/test-sql.cpp | 4 ---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index 9ac3cba43..4004e8a17 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -58,7 +59,8 @@ std::shared_ptr parse_sql_expression(std::istream& in) { if (lexer_error_listener.error()) { SPDLOG_ERROR("Lexer error: {}", lexer_error_listener.message()); return {}; - } else if (parser_error_listener.error()) { + } + if (parser_error_listener.error()) { SPDLOG_ERROR("Parser error: {}", parser_error_listener.message()); return {}; } diff --git a/components/core/src/clp_s/search/sql/sql.hpp b/components/core/src/clp_s/search/sql/sql.hpp index 45f5d960b..d23302de2 100644 --- a/components/core/src/clp_s/search/sql/sql.hpp +++ b/components/core/src/clp_s/search/sql/sql.hpp @@ -7,8 +7,8 @@ namespace clp_s::search::sql { /** - * Generate a search AST from an SQL expression in an input stream - * @param in input stream containing an SQL expression followed by EOF + * Parses an SQL expression from the given stream to generate a search AST. + * @param in Input stream containing an SQL expression followed by EOF * @return a search AST on success, nullptr otherwise */ std::shared_ptr parse_sql_expression(std::istream& in); diff --git a/components/core/tests/test-sql.cpp b/components/core/tests/test-sql.cpp index 0ab47e42e..b191a9df6 100644 --- a/components/core/tests/test-sql.cpp +++ b/components/core/tests/test-sql.cpp @@ -1,6 +1,4 @@ #include -#include -#include #include #include @@ -11,9 +9,7 @@ using clp_s::search::EmptyExpr; using clp_s::search::sql::parse_sql_expression; -using std::string; using std::stringstream; -using std::vector; TEST_CASE("Test parsing SQL", "[SQL]") { // Suppress logging From d96505e6548cfff9453549819d7f8c800a0bc394 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Fri, 9 Aug 2024 01:16:05 +0000 Subject: [PATCH 04/22] Move antlr visitor derived classes into private namespace and deduplicate ErrorListener --- .../search/antlr_common/ErrorListener.hpp | 30 +++++++++++++++++++ .../core/src/clp_s/search/kql/CMakeLists.txt | 1 + components/core/src/clp_s/search/kql/kql.cpp | 27 +++-------------- .../core/src/clp_s/search/sql/CMakeLists.txt | 1 + components/core/src/clp_s/search/sql/sql.cpp | 4 +++ 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 components/core/src/clp_s/search/antlr_common/ErrorListener.hpp diff --git a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp new file mode 100644 index 000000000..8b05a29ca --- /dev/null +++ b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp @@ -0,0 +1,30 @@ +#ifndef CLP_S_SEARCH_ANTLRCOMMON_ERRORLISTENER_HPP +#define CLP_S_SEARCH_ANTLRCOMMON_ERRORLISTENER_HPP +#include + +namespace clp_s::search::antlr_common { +class ErrorListener : public antlr4::BaseErrorListener { +public: + void syntaxError( + antlr4::Recognizer* recognizer, + antlr4::Token* offending_symbol, + size_t line, + size_t char_position_in_line, + std::string const& msg, + std::exception_ptr e + ) override { + m_error = true; + m_error_message = msg; + } + + bool error() const { return m_error; } + + std::string const& message() const { return m_error_message; } + +private: + bool m_error{false}; + std::string m_error_message; +}; +} // namespace clp_s::search::antlr_common + +#endif // CLP_S_SEARCH_ANTLRCOMMON_ERRORLISTENER_HPP diff --git a/components/core/src/clp_s/search/kql/CMakeLists.txt b/components/core/src/clp_s/search/kql/CMakeLists.txt index ee36ee124..b15990180 100644 --- a/components/core/src/clp_s/search/kql/CMakeLists.txt +++ b/components/core/src/clp_s/search/kql/CMakeLists.txt @@ -8,6 +8,7 @@ ANTLR_TARGET( add_library( kql ../../Utils.hpp + ../antlr_common/ErrorListener.hpp ../AndExpr.hpp ../BooleanLiteral.hpp ../ColumnDescriptor.hpp diff --git a/components/core/src/clp_s/search/kql/kql.cpp b/components/core/src/clp_s/search/kql/kql.cpp index fa560cef5..80c9d0acf 100644 --- a/components/core/src/clp_s/search/kql/kql.cpp +++ b/components/core/src/clp_s/search/kql/kql.cpp @@ -13,6 +13,7 @@ #include "../../Utils.hpp" #include "../AndExpr.hpp" +#include "../antlr_common/ErrorListener.hpp" #include "../BooleanLiteral.hpp" #include "../ColumnDescriptor.hpp" #include "../DateLiteral.hpp" @@ -25,31 +26,10 @@ using namespace antlr4; using namespace kql; +using clp_s::search::antlr_common::ErrorListener; namespace clp_s::search::kql { -class ErrorListener : public BaseErrorListener { -public: - void syntaxError( - Recognizer* recognizer, - Token* offending_symbol, - size_t line, - size_t char_position_in_line, - std::string const& msg, - std::exception_ptr e - ) override { - m_error = true; - m_error_message = msg; - } - - bool error() const { return m_error; } - - std::string const& message() const { return m_error_message; } - -private: - bool m_error{false}; - std::string m_error_message; -}; - +namespace { class ParseTreeVisitor : public KqlBaseVisitor { private: static void @@ -224,6 +204,7 @@ class ParseTreeVisitor : public KqlBaseVisitor { return base; } }; +} // namespace std::shared_ptr parse_kql_expression(std::istream& in) { ErrorListener lexer_error_listener; diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt index af2a8ef81..dde7f27cc 100644 --- a/components/core/src/clp_s/search/sql/CMakeLists.txt +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -8,6 +8,7 @@ ANTLR_TARGET( add_library( sql ../../Utils.hpp + ../antlr_common/ErrorListener.hpp ../AndExpr.hpp ../BooleanLiteral.hpp ../ColumnDescriptor.hpp diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index 4004e8a17..53c9d560b 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -5,6 +5,7 @@ #include #include +#include "../antlr_common/ErrorListener.hpp" #include "../EmptyExpr.hpp" #include "SqlBaseVisitor.h" #include "SqlLexer.h" @@ -12,6 +13,7 @@ using namespace antlr4; using namespace sql; +using clp_s::search::antlr_common::ErrorListener; namespace clp_s::search::sql { class ErrorListener : public BaseErrorListener { @@ -37,10 +39,12 @@ class ErrorListener : public BaseErrorListener { std::string m_error_message; }; +namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: std::any visitStart(SqlParser::StartContext* ctx) override { return EmptyExpr::create(); } }; +} // namespace std::shared_ptr parse_sql_expression(std::istream& in) { ErrorListener lexer_error_listener; From 436c396969a153063191eb0d2c0d8640c11f72e9 Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Mon, 12 Aug 2024 10:19:30 -0400 Subject: [PATCH 05/22] Apply suggestions from code review Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- .../core/src/clp_s/search/antlr_common/ErrorListener.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp index 8b05a29ca..1f0d11656 100644 --- a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp +++ b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp @@ -17,9 +17,9 @@ class ErrorListener : public antlr4::BaseErrorListener { m_error_message = msg; } - bool error() const { return m_error; } + [[nodiscard]] bool error() const { return m_error; } - std::string const& message() const { return m_error_message; } + [[nodiscard]] std::string const& message() const { return m_error_message; } private: bool m_error{false}; From 4037d5bbc760821dd940d0418c1474bd30027467 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 12 Aug 2024 14:21:48 +0000 Subject: [PATCH 06/22] Remove duplicated code --- components/core/src/clp_s/search/sql/sql.cpp | 23 -------------------- 1 file changed, 23 deletions(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index 53c9d560b..2506e0e7d 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -16,29 +16,6 @@ using namespace sql; using clp_s::search::antlr_common::ErrorListener; namespace clp_s::search::sql { -class ErrorListener : public BaseErrorListener { -public: - void syntaxError( - Recognizer* recognizer, - Token* offending_symbol, - size_t line, - size_t char_position_in_line, - std::string const& msg, - std::exception_ptr e - ) override { - m_error = true; - m_error_message = msg; - } - - bool error() const { return m_error; } - - std::string const& message() const { return m_error_message; } - -private: - bool m_error{false}; - std::string m_error_message; -}; - namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: From f8d67fbfce63b3d2c1c7cd255b5406a81626bc48 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 16 Sep 2024 17:48:53 +0000 Subject: [PATCH 07/22] Fix clang-tidy warnings --- components/core/src/clp_s/search/kql/kql.cpp | 9 +++------ components/core/src/clp_s/search/sql/sql.cpp | 11 +++++++---- components/core/src/clp_s/search/sql/sql.hpp | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/components/core/src/clp_s/search/kql/kql.cpp b/components/core/src/clp_s/search/kql/kql.cpp index 80c9d0acf..51b0d0db8 100644 --- a/components/core/src/clp_s/search/kql/kql.cpp +++ b/components/core/src/clp_s/search/kql/kql.cpp @@ -5,12 +5,6 @@ #include #include -#include "KqlBaseVisitor.h" -#include "KqlLexer.h" -#include "KqlParser.h" -// If redlining may want to add ${workspaceFolder}/build/** -// to include path for vscode C/C++ utils - #include "../../Utils.hpp" #include "../AndExpr.hpp" #include "../antlr_common/ErrorListener.hpp" @@ -23,6 +17,9 @@ #include "../NullLiteral.hpp" #include "../OrExpr.hpp" #include "../StringLiteral.hpp" +#include "KqlBaseVisitor.h" +#include "KqlLexer.h" +#include "KqlParser.h" using namespace antlr4; using namespace kql; diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index 2506e0e7d..bebb9d353 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -1,12 +1,13 @@ #include #include -#include +#include #include #include #include "../antlr_common/ErrorListener.hpp" #include "../EmptyExpr.hpp" +#include "../Expression.hpp" #include "SqlBaseVisitor.h" #include "SqlLexer.h" #include "SqlParser.h" @@ -19,11 +20,13 @@ namespace clp_s::search::sql { namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: - std::any visitStart(SqlParser::StartContext* ctx) override { return EmptyExpr::create(); } + auto visitStart(SqlParser::StartContext* ctx) -> std::any override { + return EmptyExpr::create(); + } }; } // namespace -std::shared_ptr parse_sql_expression(std::istream& in) { +auto parse_sql_expression(std::istream& in) -> std::shared_ptr { ErrorListener lexer_error_listener; ErrorListener parser_error_listener; @@ -46,7 +49,7 @@ std::shared_ptr parse_sql_expression(std::istream& in) { return {}; } - ParseTreeVisitor visitor; + ParseTreeVisitor const visitor; return std::any_cast>(visitor.visitStart(tree)); } } // namespace clp_s::search::sql diff --git a/components/core/src/clp_s/search/sql/sql.hpp b/components/core/src/clp_s/search/sql/sql.hpp index d23302de2..a1e4bbc51 100644 --- a/components/core/src/clp_s/search/sql/sql.hpp +++ b/components/core/src/clp_s/search/sql/sql.hpp @@ -2,6 +2,7 @@ #define CLP_S_SEARCH_SQL_SQL_HPP #include +#include #include "../Expression.hpp" @@ -11,7 +12,7 @@ namespace clp_s::search::sql { * @param in Input stream containing an SQL expression followed by EOF * @return a search AST on success, nullptr otherwise */ -std::shared_ptr parse_sql_expression(std::istream& in); +auto parse_sql_expression(std::istream& in) -> std::shared_ptr; } // namespace clp_s::search::sql #endif // CLP_S_SEARCH_SQL_SQL_HPP From ce70d88bd95a2c6aa858e29a44c8a87c97984edb Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 16 Sep 2024 17:55:23 +0000 Subject: [PATCH 08/22] Undo incorrect clang-tidy suggestion --- components/core/src/clp_s/search/sql/sql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index bebb9d353..8d4e72914 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -49,7 +49,7 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { return {}; } - ParseTreeVisitor const visitor; + ParseTreeVisitor visitor; return std::any_cast>(visitor.visitStart(tree)); } } // namespace clp_s::search::sql From 0f768a56d41d9f9c6452118c937ab511f1d92f95 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 16 Sep 2024 17:58:38 +0000 Subject: [PATCH 09/22] More clang-tidy fixes --- .../core/src/clp_s/search/antlr_common/ErrorListener.hpp | 6 +++--- components/core/src/clp_s/search/sql/sql.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp index 1f0d11656..0be41dfdc 100644 --- a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp +++ b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp @@ -17,13 +17,13 @@ class ErrorListener : public antlr4::BaseErrorListener { m_error_message = msg; } - [[nodiscard]] bool error() const { return m_error; } + [[nodiscard]] auto error() const -> bool { return m_error; } - [[nodiscard]] std::string const& message() const { return m_error_message; } + [[nodiscard]] auto message() const -> std::string const& { return m_error_message; } private: bool m_error{false}; - std::string m_error_message; + std::string m_error_message{}; }; } // namespace clp_s::search::antlr_common diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index 8d4e72914..eacdf1878 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -20,7 +20,7 @@ namespace clp_s::search::sql { namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: - auto visitStart(SqlParser::StartContext* ctx) -> std::any override { + auto visitStart(SqlParser::StartContext* ctx) override -> std::any { return EmptyExpr::create(); } }; From a1d8fe723374fcc949af2bc3aefbe4d5f12403d1 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Sun, 22 Sep 2024 23:02:36 +0000 Subject: [PATCH 10/22] Fix compilation error --- components/core/src/clp_s/search/sql/sql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index eacdf1878..8d4e72914 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -20,7 +20,7 @@ namespace clp_s::search::sql { namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: - auto visitStart(SqlParser::StartContext* ctx) override -> std::any { + auto visitStart(SqlParser::StartContext* ctx) -> std::any override { return EmptyExpr::create(); } }; From 1805505a8e59a9f7f12cab1ad7bc4d29977cd73d Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Wed, 25 Sep 2024 12:29:56 -0400 Subject: [PATCH 11/22] Apply suggestions from code review Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- .../search/antlr_common/ErrorListener.hpp | 24 ++++++++++++------- .../core/src/clp_s/search/sql/CMakeLists.txt | 2 +- components/core/src/clp_s/search/sql/sql.cpp | 13 ++++++---- components/core/src/clp_s/search/sql/sql.hpp | 2 +- components/core/tests/test-sql.cpp | 1 + 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp index 0be41dfdc..c470abc0a 100644 --- a/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp +++ b/components/core/src/clp_s/search/antlr_common/ErrorListener.hpp @@ -1,29 +1,35 @@ #ifndef CLP_S_SEARCH_ANTLRCOMMON_ERRORLISTENER_HPP #define CLP_S_SEARCH_ANTLRCOMMON_ERRORLISTENER_HPP + +#include +#include +#include +#include + #include namespace clp_s::search::antlr_common { class ErrorListener : public antlr4::BaseErrorListener { public: - void syntaxError( - antlr4::Recognizer* recognizer, - antlr4::Token* offending_symbol, - size_t line, - size_t char_position_in_line, + auto syntaxError( + [[maybe_unused]] antlr4::Recognizer* recognizer, + [[maybe_unused]] antlr4::Token* offending_symbol, + [[maybe_unused]] size_t line, + [[maybe_unused]] size_t char_position_in_line, std::string const& msg, - std::exception_ptr e - ) override { + [[maybe_unused]] std::exception_ptr e + ) -> void override { m_error = true; m_error_message = msg; } [[nodiscard]] auto error() const -> bool { return m_error; } - [[nodiscard]] auto message() const -> std::string const& { return m_error_message; } + [[nodiscard]] auto message() const -> std::string_view { return m_error_message; } private: bool m_error{false}; - std::string m_error_message{}; + std::string m_error_message; }; } // namespace clp_s::search::antlr_common diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt index dde7f27cc..0e6674261 100644 --- a/components/core/src/clp_s/search/sql/CMakeLists.txt +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(sql PRIVATE cxx_std_20) target_include_directories(sql PRIVATE ${ANTLR_SqlParser_OUTPUT_DIR}) -target_link_libraries(sql PRIVATE antlr4_static Boost::filesystem) +target_link_libraries(sql PRIVATE antlr4_static) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index 8d4e72914..dc1d7bc5e 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -12,15 +12,18 @@ #include "SqlLexer.h" #include "SqlParser.h" -using namespace antlr4; -using namespace sql; +using antlr4::ANTLRInputStream; +using antlr4::CommonTokenStream; using clp_s::search::antlr_common::ErrorListener; +using sql::SqlBaseVisitor; +using sql::SqlLexer; +using sql::SqlParser; namespace clp_s::search::sql { namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: - auto visitStart(SqlParser::StartContext* ctx) -> std::any override { + [[nodiscard]] auto visitStart([[maybe_unused]] SqlParser::StartContext* ctx) -> std::any override { return EmptyExpr::create(); } }; @@ -30,7 +33,7 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { ErrorListener lexer_error_listener; ErrorListener parser_error_listener; - ANTLRInputStream input(in); + ANTLRInputStream input{in}; SqlLexer lexer(&input); lexer.removeErrorListeners(); lexer.addErrorListener(&lexer_error_listener); @@ -42,7 +45,7 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { if (lexer_error_listener.error()) { SPDLOG_ERROR("Lexer error: {}", lexer_error_listener.message()); - return {}; + return nullptr; } if (parser_error_listener.error()) { SPDLOG_ERROR("Parser error: {}", parser_error_listener.message()); diff --git a/components/core/src/clp_s/search/sql/sql.hpp b/components/core/src/clp_s/search/sql/sql.hpp index a1e4bbc51..2c0045a23 100644 --- a/components/core/src/clp_s/search/sql/sql.hpp +++ b/components/core/src/clp_s/search/sql/sql.hpp @@ -12,7 +12,7 @@ namespace clp_s::search::sql { * @param in Input stream containing an SQL expression followed by EOF * @return a search AST on success, nullptr otherwise */ -auto parse_sql_expression(std::istream& in) -> std::shared_ptr; +[[nodiscard]] auto parse_sql_expression(std::istream& in) -> std::shared_ptr; } // namespace clp_s::search::sql #endif // CLP_S_SEARCH_SQL_SQL_HPP diff --git a/components/core/tests/test-sql.cpp b/components/core/tests/test-sql.cpp index b191a9df6..3f7172835 100644 --- a/components/core/tests/test-sql.cpp +++ b/components/core/tests/test-sql.cpp @@ -1,3 +1,4 @@ +#include #include #include From 4af7f86604a67a60ea755c29d7c1cde23ca50cc0 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 25 Sep 2024 16:31:10 +0000 Subject: [PATCH 12/22] Lint fix --- components/core/src/clp_s/search/sql/sql.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index dc1d7bc5e..e7988a30a 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -23,7 +23,8 @@ namespace clp_s::search::sql { namespace { class ParseTreeVisitor : public SqlBaseVisitor { public: - [[nodiscard]] auto visitStart([[maybe_unused]] SqlParser::StartContext* ctx) -> std::any override { + [[nodiscard]] auto visitStart([[maybe_unused]] SqlParser::StartContext* ctx + ) -> std::any override { return EmptyExpr::create(); } }; From d09e6c4ca24ef420f1f33d57b120a8128cdda51e Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 25 Sep 2024 18:17:37 +0000 Subject: [PATCH 13/22] Fix macOS build --- components/core/src/clp_s/search/kql/CMakeLists.txt | 2 +- components/core/src/clp_s/search/sql/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/core/src/clp_s/search/kql/CMakeLists.txt b/components/core/src/clp_s/search/kql/CMakeLists.txt index b15990180..26825cc7d 100644 --- a/components/core/src/clp_s/search/kql/CMakeLists.txt +++ b/components/core/src/clp_s/search/kql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(kql PRIVATE cxx_std_20) target_include_directories(kql PRIVATE ${ANTLR_KqlParser_OUTPUT_DIR}) -target_link_libraries(kql PRIVATE antlr4_static Boost::filesystem) +target_link_libraries(kql PRIVATE antlr4_static spdlog::spdlog) diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt index 0e6674261..6df3f57f6 100644 --- a/components/core/src/clp_s/search/sql/CMakeLists.txt +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(sql PRIVATE cxx_std_20) target_include_directories(sql PRIVATE ${ANTLR_SqlParser_OUTPUT_DIR}) -target_link_libraries(sql PRIVATE antlr4_static) +target_link_libraries(sql PRIVATE antlr4_static spdlog::spdlog) From 991ca738de12e3c0195a39148c60b0a8250217fe Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Tue, 22 Oct 2024 10:48:27 -0400 Subject: [PATCH 14/22] Apply suggestions from code review Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- components/core/src/clp_s/search/sql/sql.cpp | 8 ++++---- components/core/tests/test-sql.cpp | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index e7988a30a..b73469575 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -35,14 +35,14 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { ErrorListener parser_error_listener; ANTLRInputStream input{in}; - SqlLexer lexer(&input); + SqlLexer lexer{&input}; lexer.removeErrorListeners(); lexer.addErrorListener(&lexer_error_listener); - CommonTokenStream tokens(&lexer); + CommonTokenStream tokens{&lexer}; SqlParser parser(&tokens); parser.removeErrorListeners(); parser.addErrorListener(&parser_error_listener); - SqlParser::StartContext* tree = parser.start(); + SqlParser::StartContext* tree{parser.start()}; if (lexer_error_listener.error()) { SPDLOG_ERROR("Lexer error: {}", lexer_error_listener.message()); @@ -50,7 +50,7 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { } if (parser_error_listener.error()) { SPDLOG_ERROR("Parser error: {}", parser_error_listener.message()); - return {}; + return nullptr; } ParseTreeVisitor visitor; diff --git a/components/core/tests/test-sql.cpp b/components/core/tests/test-sql.cpp index 3f7172835..46a9a23a9 100644 --- a/components/core/tests/test-sql.cpp +++ b/components/core/tests/test-sql.cpp @@ -2,7 +2,6 @@ #include #include -#include #include "../src/clp_s/search/EmptyExpr.hpp" #include "../src/clp_s/search/sql/sql.hpp" @@ -14,11 +13,11 @@ using std::stringstream; TEST_CASE("Test parsing SQL", "[SQL]") { // Suppress logging - LogSuppressor suppressor{}; + LogSuppressor const suppressor; SECTION("Stub accepts empty string") { stringstream empty_string{""}; auto filter = std::dynamic_pointer_cast(parse_sql_expression(empty_string)); - REQUIRE(nullptr != filter); + REQUIRE((nullptr != filter)); } } From ce137598cb56da518cbb8ba44d6baee946ebf147 Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Tue, 22 Oct 2024 11:02:49 -0400 Subject: [PATCH 15/22] Update components/core/src/clp_s/search/sql/sql.cpp Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- components/core/src/clp_s/search/sql/sql.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index b73469575..ec34cab68 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -54,6 +54,10 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { } ParseTreeVisitor visitor; - return std::any_cast>(visitor.visitStart(tree)); + try { + return std::any_cast>(visitor.visitStart(tree)); + } catch (std::exception& e) { + return nullptr; + } } } // namespace clp_s::search::sql From 5696ac36af0ab6183ded67ba01091635a996741f Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 22 Oct 2024 15:00:47 +0000 Subject: [PATCH 16/22] Address more review comments --- components/core/tests/LogSuppressor.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/core/tests/LogSuppressor.hpp b/components/core/tests/LogSuppressor.hpp index adb1c00dd..db20cca26 100644 --- a/components/core/tests/LogSuppressor.hpp +++ b/components/core/tests/LogSuppressor.hpp @@ -1,3 +1,8 @@ +#ifndef TESTS_LOGSUPPRESSOR_HPP +#define TESTS_LOGSUPPRESSOR_HPP + +#include + /** * A class that suppresses logs so long as it's instantiated. */ @@ -19,3 +24,5 @@ class LogSuppressor { private: spdlog::level::level_enum m_previous_logging_level; }; + +#endif // TESTS_LOGSUPPRESSOR_HPP From 712afbe85da3f699777e7eda3c6c5a2ccd7ba633 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 22 Oct 2024 15:06:06 +0000 Subject: [PATCH 17/22] Add comment indicating sql grammar is incomplete boilerplate --- components/core/src/clp_s/search/sql/Sql.g4 | 1 + 1 file changed, 1 insertion(+) diff --git a/components/core/src/clp_s/search/sql/Sql.g4 b/components/core/src/clp_s/search/sql/Sql.g4 index cabf3e068..d22d8c3d0 100644 --- a/components/core/src/clp_s/search/sql/Sql.g4 +++ b/components/core/src/clp_s/search/sql/Sql.g4 @@ -1,3 +1,4 @@ +# Boilerplate for work in progress SQL grammar. grammar Sql; start: EOF ; From c2432bba9d8eba74e9dbe6658f99f1c8f74bccc1 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 23 Oct 2024 16:49:56 +0000 Subject: [PATCH 18/22] Minor fix --- components/core/src/clp_s/search/sql/Sql.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/Sql.g4 b/components/core/src/clp_s/search/sql/Sql.g4 index d22d8c3d0..13abd9146 100644 --- a/components/core/src/clp_s/search/sql/Sql.g4 +++ b/components/core/src/clp_s/search/sql/Sql.g4 @@ -1,4 +1,4 @@ -# Boilerplate for work in progress SQL grammar. +// Boilerplate for work in progress SQL grammar. grammar Sql; start: EOF ; From cd7f1648a43bc64c2bf46597493d920856ddefa2 Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Wed, 23 Oct 2024 17:28:26 -0400 Subject: [PATCH 19/22] Update components/core/src/clp_s/search/sql/sql.cpp Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- components/core/src/clp_s/search/sql/sql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index ec34cab68..a75447a11 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -56,7 +56,7 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { ParseTreeVisitor visitor; try { return std::any_cast>(visitor.visitStart(tree)); - } catch (std::exception& e) { + } catch (std::exception const& e) { return nullptr; } } From 29f8744b3e0d935e025010541966311aa842a35f Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 18 Nov 2024 18:43:35 +0000 Subject: [PATCH 20/22] Remove spdlog dependency to fix build issue on macOS --- components/core/src/clp_s/search/sql/CMakeLists.txt | 2 +- components/core/src/clp_s/search/sql/sql.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt index 6df3f57f6..0e6674261 100644 --- a/components/core/src/clp_s/search/sql/CMakeLists.txt +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(sql PRIVATE cxx_std_20) target_include_directories(sql PRIVATE ${ANTLR_SqlParser_OUTPUT_DIR}) -target_link_libraries(sql PRIVATE antlr4_static spdlog::spdlog) +target_link_libraries(sql PRIVATE antlr4_static) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index a75447a11..b6dd939cb 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -3,7 +3,6 @@ #include #include -#include #include "../antlr_common/ErrorListener.hpp" #include "../EmptyExpr.hpp" @@ -45,11 +44,9 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { SqlParser::StartContext* tree{parser.start()}; if (lexer_error_listener.error()) { - SPDLOG_ERROR("Lexer error: {}", lexer_error_listener.message()); return nullptr; } if (parser_error_listener.error()) { - SPDLOG_ERROR("Parser error: {}", parser_error_listener.message()); return nullptr; } From f0118f105e3e5fcab3e1a7e95481e4c92aa59c84 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 18 Nov 2024 19:03:50 +0000 Subject: [PATCH 21/22] Revert "Remove spdlog dependency to fix build issue on macOS" This reverts commit 29f8744b3e0d935e025010541966311aa842a35f. --- components/core/src/clp_s/search/sql/CMakeLists.txt | 2 +- components/core/src/clp_s/search/sql/sql.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt index 0e6674261..6df3f57f6 100644 --- a/components/core/src/clp_s/search/sql/CMakeLists.txt +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(sql PRIVATE cxx_std_20) target_include_directories(sql PRIVATE ${ANTLR_SqlParser_OUTPUT_DIR}) -target_link_libraries(sql PRIVATE antlr4_static) +target_link_libraries(sql PRIVATE antlr4_static spdlog::spdlog) diff --git a/components/core/src/clp_s/search/sql/sql.cpp b/components/core/src/clp_s/search/sql/sql.cpp index b6dd939cb..a75447a11 100644 --- a/components/core/src/clp_s/search/sql/sql.cpp +++ b/components/core/src/clp_s/search/sql/sql.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "../antlr_common/ErrorListener.hpp" #include "../EmptyExpr.hpp" @@ -44,9 +45,11 @@ auto parse_sql_expression(std::istream& in) -> std::shared_ptr { SqlParser::StartContext* tree{parser.start()}; if (lexer_error_listener.error()) { + SPDLOG_ERROR("Lexer error: {}", lexer_error_listener.message()); return nullptr; } if (parser_error_listener.error()) { + SPDLOG_ERROR("Parser error: {}", parser_error_listener.message()); return nullptr; } From 866dcfcd1757aeb81740dd271c6055170c97d30f Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 18 Nov 2024 19:07:49 +0000 Subject: [PATCH 22/22] Attempt to fix macOS build issues --- components/core/src/clp_s/search/kql/CMakeLists.txt | 2 +- components/core/src/clp_s/search/sql/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/core/src/clp_s/search/kql/CMakeLists.txt b/components/core/src/clp_s/search/kql/CMakeLists.txt index 26825cc7d..c1073b01e 100644 --- a/components/core/src/clp_s/search/kql/CMakeLists.txt +++ b/components/core/src/clp_s/search/kql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(kql PRIVATE cxx_std_20) target_include_directories(kql PRIVATE ${ANTLR_KqlParser_OUTPUT_DIR}) -target_link_libraries(kql PRIVATE antlr4_static spdlog::spdlog) +target_link_libraries(kql PRIVATE antlr4_static) diff --git a/components/core/src/clp_s/search/sql/CMakeLists.txt b/components/core/src/clp_s/search/sql/CMakeLists.txt index 6df3f57f6..0e6674261 100644 --- a/components/core/src/clp_s/search/sql/CMakeLists.txt +++ b/components/core/src/clp_s/search/sql/CMakeLists.txt @@ -26,4 +26,4 @@ add_library( ) target_compile_features(sql PRIVATE cxx_std_20) target_include_directories(sql PRIVATE ${ANTLR_SqlParser_OUTPUT_DIR}) -target_link_libraries(sql PRIVATE antlr4_static spdlog::spdlog) +target_link_libraries(sql PRIVATE antlr4_static)