refactor(clp-s): Split up clp-s code to create clp_s::search::ast and clp_s::TimestampPattern libraries.#790
Conversation
…rch::ast namespace
WalkthroughThis pull request restructures the codebase by migrating a wide range of files and references from the original Changes
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.
⏰ Context from checks skipped due to timeout of 90000ms (11)
🔇 Additional comments (6)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (7)
components/core/src/clp_s/search/ast/FilterOperation.hpp (2)
1-2: Consider updating header guards to match the new namespace structure.The header guards still use
CLP_S_SEARCH_FILTEROPERATION_HPPinstead of something that reflects the newastnamespace. While this won't affect functionality, it might be more consistent to update them.-#ifndef CLP_S_SEARCH_FILTEROPERATION_HPP -#define CLP_S_SEARCH_FILTEROPERATION_HPP +#ifndef CLP_S_SEARCH_AST_FILTEROPERATION_HPP +#define CLP_S_SEARCH_AST_FILTEROPERATION_HPP
20-20: Update header guard end comment to match any changes to the header guard.If you update the header guards as suggested above, don't forget to update this end comment as well.
-#endif // CLP_S_SEARCH_FILTEROPERATION_HPP +#endif // CLP_S_SEARCH_AST_FILTEROPERATION_HPPcomponents/core/src/clp_s/search/ast/FilterExpr.cpp (1)
99-107: Consider adding more context to get_operand return value.The method returns nullptr if there isn't a second operand, which might be surprising to callers. Consider either adding documentation to clarify this behavior or adding a check before incrementing the iterator.
std::shared_ptr<Literal> FilterExpr::get_operand() { auto it = op_begin(); + // First operand is the column descriptor, second is the actual operand it++; if (it == op_end()) { + // Return nullptr if there is no operand (e.g., for EXISTS operation) return nullptr; } else { return std::static_pointer_cast<Literal>(*it); } }components/core/src/clp_s/search/ast/Transformation.hpp (2)
1-2: Consider updating header guards to match the new namespace structure.The header guards still use
CLP_S_SEARCH_TRANSFORMATION_HPPinstead of something that reflects the newastnamespace. While this won't affect functionality, it might be more consistent to update them.-#ifndef CLP_S_SEARCH_TRANSFORMATION_HPP -#define CLP_S_SEARCH_TRANSFORMATION_HPP +#ifndef CLP_S_SEARCH_AST_TRANSFORMATION_HPP +#define CLP_S_SEARCH_AST_TRANSFORMATION_HPP
21-21: Update header guard end comment to match any changes to the header guard.If you update the header guards as suggested above, don't forget to update this end comment as well.
-#endif // CLP_S_SEARCH_TRANSFORMATION_HPP +#endif // CLP_S_SEARCH_AST_TRANSFORMATION_HPPcomponents/core/src/clp_s/search/ast/Integral.hpp (1)
12-13: FIXME Note: Investigate Bitmask Inclusion
There is a FIXME comment regarding why String types are included in the integral bitmask. It would be beneficial to revisit this design decision and either document the rationale or refactor the bitmask usage.components/core/src/clp_s/search/ast/OrOfAndForm.cpp (1)
34-37: Boolean Negation Style
In lines 34–37 the code uses the negation operator (!expr->is_inverted()) within calls toOrExpr::createandAndExpr::create. According to our coding guidelines for C++ files, it is preferable to usefalse == expr->is_inverted()instead. This change would further standardise the code style.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (71)
components/core/CMakeLists.txt(1 hunks)components/core/src/clp_s/CMakeLists.txt(3 hunks)components/core/src/clp_s/JsonParser.cpp(3 hunks)components/core/src/clp_s/SchemaTree.cpp(1 hunks)components/core/src/clp_s/SchemaTree.hpp(2 hunks)components/core/src/clp_s/TimestampDictionaryReader.cpp(2 hunks)components/core/src/clp_s/TimestampDictionaryReader.hpp(0 hunks)components/core/src/clp_s/TimestampEntry.cpp(1 hunks)components/core/src/clp_s/TimestampEntry.hpp(2 hunks)components/core/src/clp_s/TimestampPattern.hpp(1 hunks)components/core/src/clp_s/Utils.cpp(0 hunks)components/core/src/clp_s/Utils.hpp(0 hunks)components/core/src/clp_s/clp-s.cpp(9 hunks)components/core/src/clp_s/indexer/CMakeLists.txt(1 hunks)components/core/src/clp_s/search/AddTimestampConditions.cpp(1 hunks)components/core/src/clp_s/search/AddTimestampConditions.hpp(3 hunks)components/core/src/clp_s/search/EvaluateTimestampIndex.cpp(1 hunks)components/core/src/clp_s/search/EvaluateTimestampIndex.hpp(2 hunks)components/core/src/clp_s/search/Output.cpp(3 hunks)components/core/src/clp_s/search/Output.hpp(22 hunks)components/core/src/clp_s/search/Projection.cpp(2 hunks)components/core/src/clp_s/search/Projection.hpp(3 hunks)components/core/src/clp_s/search/SchemaMatch.cpp(1 hunks)components/core/src/clp_s/search/SchemaMatch.hpp(8 hunks)components/core/src/clp_s/search/ast/AndExpr.cpp(2 hunks)components/core/src/clp_s/search/ast/AndExpr.hpp(2 hunks)components/core/src/clp_s/search/ast/BooleanLiteral.cpp(2 hunks)components/core/src/clp_s/search/ast/BooleanLiteral.hpp(2 hunks)components/core/src/clp_s/search/ast/CMakeLists.txt(1 hunks)components/core/src/clp_s/search/ast/ColumnDescriptor.cpp(2 hunks)components/core/src/clp_s/search/ast/ColumnDescriptor.hpp(2 hunks)components/core/src/clp_s/search/ast/ConstantProp.cpp(2 hunks)components/core/src/clp_s/search/ast/ConstantProp.hpp(2 hunks)components/core/src/clp_s/search/ast/ConvertToExists.cpp(2 hunks)components/core/src/clp_s/search/ast/ConvertToExists.hpp(2 hunks)components/core/src/clp_s/search/ast/DateLiteral.cpp(2 hunks)components/core/src/clp_s/search/ast/DateLiteral.hpp(2 hunks)components/core/src/clp_s/search/ast/EmptyExpr.cpp(2 hunks)components/core/src/clp_s/search/ast/EmptyExpr.hpp(2 hunks)components/core/src/clp_s/search/ast/Expression.cpp(2 hunks)components/core/src/clp_s/search/ast/Expression.hpp(2 hunks)components/core/src/clp_s/search/ast/FilterExpr.cpp(2 hunks)components/core/src/clp_s/search/ast/FilterExpr.hpp(2 hunks)components/core/src/clp_s/search/ast/FilterOperation.hpp(2 hunks)components/core/src/clp_s/search/ast/Integral.cpp(2 hunks)components/core/src/clp_s/search/ast/Integral.hpp(2 hunks)components/core/src/clp_s/search/ast/Literal.hpp(2 hunks)components/core/src/clp_s/search/ast/NarrowTypes.cpp(2 hunks)components/core/src/clp_s/search/ast/NarrowTypes.hpp(2 hunks)components/core/src/clp_s/search/ast/NullLiteral.cpp(2 hunks)components/core/src/clp_s/search/ast/NullLiteral.hpp(2 hunks)components/core/src/clp_s/search/ast/OrExpr.cpp(2 hunks)components/core/src/clp_s/search/ast/OrExpr.hpp(2 hunks)components/core/src/clp_s/search/ast/OrOfAndForm.cpp(2 hunks)components/core/src/clp_s/search/ast/OrOfAndForm.hpp(2 hunks)components/core/src/clp_s/search/ast/SearchUtils.cpp(3 hunks)components/core/src/clp_s/search/ast/SearchUtils.hpp(2 hunks)components/core/src/clp_s/search/ast/StringLiteral.cpp(2 hunks)components/core/src/clp_s/search/ast/StringLiteral.hpp(2 hunks)components/core/src/clp_s/search/ast/Transformation.hpp(2 hunks)components/core/src/clp_s/search/ast/Value.hpp(2 hunks)components/core/src/clp_s/search/kql/CMakeLists.txt(1 hunks)components/core/src/clp_s/search/kql/kql.cpp(5 hunks)components/core/src/clp_s/search/kql/kql.hpp(1 hunks)components/core/src/clp_s/search/sql/CMakeLists.txt(1 hunks)components/core/src/clp_s/search/sql/sql.cpp(2 hunks)components/core/src/clp_s/search/sql/sql.hpp(1 hunks)components/core/tests/test-clp_s-search.cpp(2 hunks)components/core/tests/test-kql.cpp(1 hunks)components/core/tests/test-sql.cpp(1 hunks)lint-tasks.yml(1 hunks)
💤 Files with no reviewable changes (3)
- components/core/src/clp_s/TimestampDictionaryReader.hpp
- components/core/src/clp_s/Utils.hpp
- components/core/src/clp_s/Utils.cpp
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Preferfalse == <expression>rather than!<expression>.
components/core/src/clp_s/TimestampPattern.hppcomponents/core/src/clp_s/search/ast/Transformation.hppcomponents/core/src/clp_s/search/ast/ConvertToExists.cppcomponents/core/src/clp_s/search/ast/ConvertToExists.hppcomponents/core/src/clp_s/search/ast/FilterOperation.hppcomponents/core/src/clp_s/search/ast/ColumnDescriptor.cppcomponents/core/src/clp_s/search/ast/Expression.hppcomponents/core/src/clp_s/search/ast/EmptyExpr.cppcomponents/core/src/clp_s/search/ast/ConstantProp.cppcomponents/core/src/clp_s/search/ast/Integral.hppcomponents/core/src/clp_s/search/ast/Value.hppcomponents/core/src/clp_s/search/ast/OrExpr.hppcomponents/core/src/clp_s/search/ast/Literal.hppcomponents/core/src/clp_s/search/ast/OrExpr.cppcomponents/core/src/clp_s/search/ast/DateLiteral.hppcomponents/core/src/clp_s/search/ast/NullLiteral.cppcomponents/core/src/clp_s/search/ast/EmptyExpr.hppcomponents/core/src/clp_s/search/ast/BooleanLiteral.hppcomponents/core/src/clp_s/search/ast/Integral.cppcomponents/core/src/clp_s/search/ast/ConstantProp.hppcomponents/core/src/clp_s/search/ast/NullLiteral.hppcomponents/core/src/clp_s/search/ast/FilterExpr.cppcomponents/core/src/clp_s/search/ast/NarrowTypes.cppcomponents/core/src/clp_s/search/ast/NarrowTypes.hppcomponents/core/src/clp_s/search/ast/AndExpr.hppcomponents/core/src/clp_s/search/ast/OrOfAndForm.cppcomponents/core/src/clp_s/search/ast/Expression.cppcomponents/core/src/clp_s/search/ast/ColumnDescriptor.hppcomponents/core/src/clp_s/TimestampEntry.cppcomponents/core/src/clp_s/search/ast/OrOfAndForm.hppcomponents/core/src/clp_s/search/ast/DateLiteral.cppcomponents/core/src/clp_s/search/sql/sql.cppcomponents/core/src/clp_s/search/AddTimestampConditions.cppcomponents/core/src/clp_s/TimestampDictionaryReader.cppcomponents/core/src/clp_s/search/ast/SearchUtils.hppcomponents/core/src/clp_s/search/kql/kql.hppcomponents/core/src/clp_s/search/Projection.cppcomponents/core/tests/test-sql.cppcomponents/core/src/clp_s/search/ast/BooleanLiteral.cppcomponents/core/src/clp_s/search/EvaluateTimestampIndex.hppcomponents/core/src/clp_s/SchemaTree.hppcomponents/core/src/clp_s/search/ast/StringLiteral.cppcomponents/core/src/clp_s/SchemaTree.cppcomponents/core/src/clp_s/search/EvaluateTimestampIndex.cppcomponents/core/src/clp_s/search/ast/FilterExpr.hppcomponents/core/src/clp_s/search/ast/AndExpr.cppcomponents/core/src/clp_s/search/ast/SearchUtils.cppcomponents/core/src/clp_s/search/AddTimestampConditions.hppcomponents/core/tests/test-clp_s-search.cppcomponents/core/src/clp_s/clp-s.cppcomponents/core/src/clp_s/search/ast/StringLiteral.hppcomponents/core/src/clp_s/search/sql/sql.hppcomponents/core/src/clp_s/search/Projection.hppcomponents/core/src/clp_s/search/SchemaMatch.cppcomponents/core/src/clp_s/search/Output.cppcomponents/core/src/clp_s/TimestampEntry.hppcomponents/core/src/clp_s/JsonParser.cppcomponents/core/tests/test-kql.cppcomponents/core/src/clp_s/search/kql/kql.cppcomponents/core/src/clp_s/search/SchemaMatch.hppcomponents/core/src/clp_s/search/Output.hpp
🧬 Code Definitions (5)
components/core/src/clp_s/search/EvaluateTimestampIndex.hpp (3)
components/core/src/clp_s/search/Output.hpp (6)
expr(122-122)expr(130-130)expr(138-138)expr(345-345)expr(360-360)expr(366-366)components/core/src/clp_s/search/SchemaMatch.hpp (2)
expr(27-27)expr(143-147)components/core/src/clp_s/search/AddTimestampConditions.hpp (1)
expr(41-41)
components/core/src/clp_s/SchemaTree.cpp (2)
components/core/src/clp_s/search/ast/StringLiteral.hpp (2)
type(40-40)type(40-40)components/core/src/clp_s/ColumnReader.hpp (6)
Integer(82-82)Float(105-105)VarString(210-210)Boolean(128-128)DateString(247-247)Unknown(39-39)
components/core/src/clp_s/search/Output.cpp (2)
components/core/src/clp_s/search/ast/SearchUtils.hpp (1)
has_unescaped_wildcards(67-67)components/core/src/clp_s/search/ast/SearchUtils.cpp (2)
has_unescaped_wildcards(137-147)has_unescaped_wildcards(137-137)
components/core/src/clp_s/search/SchemaMatch.hpp (3)
components/core/src/clp_s/search/Output.hpp (6)
expr(122-122)expr(130-130)expr(138-138)expr(345-345)expr(360-360)expr(366-366)components/core/src/clp_s/search/AddTimestampConditions.hpp (1)
expr(41-41)components/core/src/clp_s/search/Projection.hpp (1)
column(42-42)
components/core/src/clp_s/search/Output.hpp (4)
components/core/src/clp_s/search/AddTimestampConditions.hpp (1)
expr(41-41)components/core/src/clp_s/search/SchemaMatch.hpp (5)
expr(27-27)expr(143-147)schema(33-33)schema(48-48)schema(55-55)components/core/src/clp_s/search/EvaluateTimestampIndex.hpp (1)
expr(26-26)components/core/src/clp_s/search/ast/StringLiteral.hpp (2)
op(56-56)op(58-58)
🪛 Cppcheck (2.10-2)
components/core/tests/test-kql.cpp
[performance] 12-12: Variable 'm_previous_logging_level' is assigned in constructor body. Consider performing initialization in initialization list.
(useInitializationList)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: centos-stream-9-dynamic-linked-bins
- GitHub Check: centos-stream-9-static-linked-bins
- GitHub Check: ubuntu-jammy-static-linked-bins
- GitHub Check: ubuntu-jammy-dynamic-linked-bins
- GitHub Check: ubuntu-jammy-lint
- GitHub Check: build-macos (macos-14, false)
- GitHub Check: build-macos (macos-15, false)
- GitHub Check: build-macos (macos-15, true)
- GitHub Check: build-macos (macos-13, true)
- GitHub Check: build-macos (macos-13, false)
🔇 Additional comments (195)
components/core/src/clp_s/search/ast/ConvertToExists.hpp (1)
6-6: Appropriate namespace change for the restructuringThe namespace change from
clp_s::searchtoclp_s::search::astis consistent with the PR objective of creating a dedicatedclp_s::search::astlibrary. This helps in better organization of the AST-related components.Also applies to: 27-27
components/core/src/clp_s/TimestampPattern.hpp (1)
14-14: Proper include for dependencyThe addition of the
ErrorCode.hppinclude is necessary as it's used in theOperationFailedexception class constructor. This ensures the class has access to all required dependencies.components/core/src/clp_s/search/ast/Expression.cpp (1)
3-3: Namespace updated to match new structureThe namespace change from
clp_s::searchtoclp_s::search::astaligns with the PR objective of reorganizing AST-related components into a dedicated namespace.Also applies to: 35-35
components/core/src/clp_s/search/ast/Literal.hpp (1)
9-9: Consistent namespace restructuringThe namespace change properly places the
Literalclass in theclp_s::search::astnamespace, which is consistent with the overall architecture changes in this PR.Also applies to: 108-108
components/core/src/clp_s/search/ast/EmptyExpr.cpp (1)
3-3: Namespace updated as part of restructuringThe namespace change from
clp_s::searchtoclp_s::search::astis consistent with the PR's goal of reorganizing the codebase.Also applies to: 27-27
components/core/src/clp_s/search/ast/ConstantProp.cpp (1)
9-9: Namespace updated correctly.The namespace has been properly changed from
clp_s::searchtoclp_s::search::astwhich aligns with the PR objective of reorganizing the codebase.Also applies to: 43-43
components/core/src/clp_s/search/ast/FilterOperation.hpp (1)
4-4: Namespace updated correctly.The namespace has been properly changed from
clp_s::searchtoclp_s::search::astwhich aligns with the PR objective of reorganizing the codebase.Also applies to: 18-18
components/core/src/clp_s/search/ast/FilterExpr.cpp (1)
3-3: Namespace updated correctly.The namespace has been properly changed from
clp_s::searchtoclp_s::search::astwhich aligns with the PR objective of reorganizing the codebase.Also applies to: 108-108
components/core/src/clp_s/search/ast/Transformation.hpp (1)
6-6: Namespace updated correctly.The namespace has been properly changed from
clp_s::searchtoclp_s::search::astwhich aligns with the PR objective of reorganizing the codebase.Also applies to: 19-19
components/core/src/clp_s/search/ast/OrExpr.cpp (1)
3-3: Namespace updated correctly.The namespace has been properly changed from
clp_s::searchtoclp_s::search::astwhich aligns with the PR objective of reorganizing the codebase.Also applies to: 55-55
components/core/src/clp_s/search/ast/Expression.hpp (2)
10-10: Namespace Update: Declaration Change
The namespace declaration has been correctly updated toclp_s::search::ast, which reflects the new modular organisation of the AST components.
116-116: Namespace Closure Update: Correct End Marker
The closing namespace directive is properly updated toclp_s::search::ast, ensuring that the entire class definition remains within the intended scope.components/core/src/clp_s/search/ast/FilterExpr.hpp (2)
11-11: Namespace Declaration Update
The namespace declaration has been updated toclp_s::search::ast, aligning this header with the new code structure.
98-98: Namespace Closure Consistency
The updated closing namespace directive confirms that all definitions are correctly encapsulated withinclp_s::search::ast.components/core/src/clp_s/search/ast/StringLiteral.cpp (3)
5-5: Include Directive Revision
Changing the include from"Utils.hpp"to"SearchUtils.hpp"is a good move. This update aligns better with the new organisational hierarchy for AST utilities.
7-7: Namespace Declaration Update
The namespace is now correctly declared asclp_s::search::ast, which ensures that theStringLiteralimplementation is scoped appropriately within the AST module.
95-95: Namespace Closure Update
The closing brace now properly marks the end of theclp_s::search::astnamespace, keeping the code well-organised and encapsulated.components/core/src/clp_s/search/ast/AndExpr.hpp (2)
6-6: Namespace Declaration Refactoring
The namespace declaration has been updated toclp_s::search::ast, clearly grouping the AST-specific classes.
56-56: Namespace Closure Confirmation
The closing namespace directive now correctly reflects the new namespace structure, ensuring consistency throughout the file.components/core/src/clp_s/search/ast/Integral.hpp (2)
10-10: Namespace Declaration Updated
The namespace is now declared asclp_s::search::ast, which is consistent with the overall restructuring of the codebase.
80-80: Namespace Closure Consistency
The closing namespace directive is updated correctly, ensuring the file’s contents remain within theclp_s::search::astscope.components/core/src/clp_s/search/ast/AndExpr.cpp (2)
5-5: Namespace declaration update.
The declaration on line 5 now correctly usesnamespace clp_s::search::ast, aligning this file with the new project structure.
57-57: Proper closing of the namespace.
The closing brace on line 57 now accurately reflects the updated namespace. Great work maintaining consistency across the file.components/core/src/clp_s/search/ast/NullLiteral.cpp (2)
3-3: Namespace update in effect.
Line 3 introduces the new namespaceclp_s::search::astproperly. This change is consistent with the overall reorganisation effort.
32-32: Namespace closure confirmation.
The closing namespace directive on line 32 correctly terminates the scope forclp_s::search::ast.components/core/src/clp_s/search/ast/ConvertToExists.cpp (2)
11-11: Updated namespace declaration.
The updated namespace on line 11 (clp_s::search::ast) is now in place, ensuring that the file is part of the refactored AST module.
116-116: Correct closure for the updated namespace.
The closing brace on line 116 now properly concludes the namespace block introduced at the start.components/core/src/clp_s/search/ast/NarrowTypes.hpp (2)
9-9: Namespace correction in header.
Line 9 correctly introduces theclp_s::search::astnamespace for theNarrowTypesclass, in line with the reorganisation strategy.
26-27: Updated closing namespace directive.
The closing directive now matches the new namespace structure perfectly.components/core/src/clp_s/search/ast/Value.hpp (2)
6-6: Namespace update implemented.
The namespace declaration on line 6 has been modified toclp_s::search::ast, ensuring consistency across related modules.
31-32: Correct namespace closure.
The closing brace on line 31 correctly finishes the updated namespace block.components/core/src/clp_s/search/ast/EmptyExpr.hpp (2)
6-6: Namespace Declaration Updated
The namespace declaration has been updated toclp_s::search::ast, which clearly reflects the new modular structure for AST components. This change improves code clarity and consistency with the broader refactoring.
35-35: Consistent Namespace Closure
The closing namespace marker now correctly reads} // namespace clp_s::search::ast, ensuring that the file remains fully consistent with the new namespace hierarchy.components/core/src/clp_s/search/ast/ConstantProp.hpp (2)
6-6: Namespace Declaration Updated
The namespace in this header has been shifted toclp_s::search::ast, aligning it with the reorganisation of AST-related classes. This update promotes better modular separation within the codebase.
21-21: Consistent Namespace Closure
The closing bracket now properly declares the end of theclp_s::search::astnamespace. This ensures that all entities in the file are correctly scoped.components/core/src/clp_s/search/ast/OrOfAndForm.cpp (2)
7-7: Namespace Relocation
The namespace has been updated toclp_s::search::astat the start of the file. This refactoring supports the overall modular structure established in this PR and is consistently applied.
179-179: Namespace Closure Consistency
The closing namespace comment now correctly refers toclp_s::search::ast. This consistent update ensures the file adheres to the new namespace convention.components/core/src/clp_s/search/ast/Integral.cpp (2)
7-7: Namespace Update
The namespace change toclp_s::search::astis cleanly implemented at the beginning of the file. This aligns the Integral class with the new AST sub-namespace as intended.
96-96: Consistent Namespace Closure
The file’s closing namespace marker is now in line with the reorganisation, identifying the correctclp_s::search::astnamespace.components/core/src/clp_s/search/ast/NullLiteral.hpp (2)
10-10: Namespace Declaration Updated
The file now declares its contents within theclp_s::search::astnamespace. This change reinforces the newly introduced modular separation for AST elements.
52-52: Proper Namespace Closure
The closing of the namespace is correctly updated to matchclp_s::search::ast, ensuring that all declarations within this header reside in the appropriate namespace.components/core/src/clp_s/search/ast/DateLiteral.hpp (3)
6-6: Include path updated correctly to match new directory structure.The include path for Defs.hpp has been properly updated to reflect the new location of the DateLiteral.hpp file in the ast subdirectory.
9-9: Namespace updated to reflect new code organization.The namespace has been correctly updated from
clp_s::searchtoclp_s::search::astas part of the code refactoring to create a dedicated AST library.
61-61: Closing namespace comment updated to match new namespace.The closing namespace comment has been properly updated to reflect the new namespace structure.
components/core/src/clp_s/search/ast/BooleanLiteral.hpp (2)
10-10: Namespace updated to reflect new code organization.The namespace has been correctly updated from
clp_s::searchtoclp_s::search::astas part of the code refactoring to create a dedicated AST library.
56-56: Closing namespace comment updated to match new namespace.The closing namespace comment has been properly updated to reflect the new namespace structure.
components/core/src/clp_s/search/ast/OrExpr.hpp (2)
6-6: Namespace updated to reflect new code organization.The namespace has been correctly updated from
clp_s::searchtoclp_s::search::astas part of the code refactoring to create a dedicated AST library.
51-51: Closing namespace comment updated to match new namespace.The closing namespace comment has been properly updated to reflect the new namespace structure.
components/core/src/clp_s/search/ast/NarrowTypes.cpp (3)
12-12: Namespace updated to reflect new code organization.The namespace has been correctly updated from
clp_s::searchtoclp_s::search::astas part of the code refactoring to create a dedicated AST library.
55-82: Code follows project's coding guidelines for boolean expressions.The code correctly uses
false == literal->as_any(op)rather than!literal->as_any(op)which is consistent with the coding guidelines that preferfalse == <expression>over!<expression>.
138-138: Closing namespace comment updated to match new namespace.The closing namespace comment has been properly updated to reflect the new namespace structure.
components/core/src/clp_s/search/ast/ColumnDescriptor.cpp (2)
5-5: Namespace Update Verification
The namespace has been correctly updated toclp_s::search::ast, which clearly delineates the AST-related components. Please ensure that all related header files are updated accordingly.
122-122: Namespace Closure Consistency
The closing namespace directive is now correctly marked forclp_s::search::ast.components/core/src/clp_s/indexer/CMakeLists.txt (1)
58-59: Updated Source File Paths
The modifications redirect the source file paths forSearchUtils.cppandSearchUtils.hppfrom the old location to the new../search/ast/directory, which is consistent with the reorganisation. Ensure that any dependent modules reference these new paths correctly.components/core/src/clp_s/search/ast/OrOfAndForm.hpp (2)
10-10: Namespace Modification in Header
The namespace declaration is now updated toclp_s::search::astfor theOrOfAndFormclass. This change aligns well with the new project structure.
64-64: Namespace Closure in Header
The closing of the namespace is correctly updated and matches the modified opening.components/core/src/clp_s/search/ast/BooleanLiteral.cpp (2)
3-3: Namespace Update for BooleanLiteral
The updated namespaceclp_s::search::astnow correctly encapsulates theBooleanLiteralimplementation, which is in line with the overall refactoring objective.
44-44: Proper Namespace Closure
The closing directive for the namespace is updated and correctly reflects the new module structure.components/core/src/clp_s/TimestampEntry.cpp (6)
6-7: Include Directive Update
The addition of#include "search/ast/FilterOperation.hpp"ensures that theFilterOperationenum is accessible. Verify that the relative include path is accurate relative to the file’s location.
9-10: Using Declaration for FilterOperation
The statementusing clp_s::search::ast::FilterOperation;simplifies the usage of the enum in the file. This improves code clarity and maintains consistency with the new namespace.
145-198: Filter Evaluation (Double Timestamp) Logic
The switch-case structure handling variousFilterOperationvalues for a double timestamp is comprehensive. Please verify that returningEvaluatedValue::Unknownin certain conditions aligns with the desired semantics for ambiguous cases.
254-315: Filter Evaluation (epochtime_t) Logic
The implementation utilisingstd::ceilandstd::floorfor double-to-epochtime conversions is appropriate. Confirm that these rounding rules meet the business requirements for accurate filtering, especially at the boundary values.
370-377: Begin Timestamp Getter Logic
The logic inget_begin_timestampdistinguishes correctly betweenEpochandDoubleEpochencodings. Casting the double value for epoch timestamps is handled as intended.
379-386: End Timestamp Getter Logic
The use ofstd::ceilinget_end_timestampto convert double epoch values is logical. Please verify that this approach does not introduce unintended rounding issues in critical timestamp comparisons.components/core/src/clp_s/search/ast/SearchUtils.hpp (3)
5-5: Appropriate include added for string_viewThe inclusion of
<string_view>is necessary for the new functionhas_unescaped_wildcardswhich usesstd::string_viewas its parameter type.
11-11: Namespace updated to match restructuring objectivesThe namespace has been updated from
clp_s::searchtoclp_s::search::ast, which aligns with the PR's objective of reorganizing the codebase.
62-67: Well-documented new function with appropriate attributesThe new
has_unescaped_wildcardsfunction is properly documented with a clear description of its purpose and return value. The use of[[nodiscard]]is appropriate as the return value shouldn't be ignored.components/core/src/clp_s/search/ast/DateLiteral.cpp (2)
5-5: Include path correctly updated for new directory structureThe include path has been updated from
../TimestampPattern.hppto../../TimestampPattern.hppto account for the file's move to theastsubdirectory.
8-8: Namespace updated to match restructuring objectivesThe namespace has been updated from
clp_s::searchtoclp_s::search::ast, which aligns with the PR's objective of reorganizing the codebase.components/core/src/clp_s/search/kql/kql.hpp (2)
6-6: Include path correctly updated for new directory structureThe include path has been updated from
../Expression.hppto../ast/Expression.hppto reflect the reorganization of code as described in the PR objectives.
14-14: Function signature properly updated with fully qualified namespaceThe function signature has been updated to use the fully qualified namespace for the return type (
std::shared_ptr<clp_s::search::ast::Expression>) which is necessary due to the namespace reorganization.components/core/src/clp_s/search/ast/CMakeLists.txt (4)
1-39: Comprehensive source file listing for the new libraryThe
CLP_S_AST_SOURCESvariable includes all the necessary AST-related source and header files that have been moved to the new namespace. This ensures that all components are properly included in the build.
41-47: Core dependencies properly includedThe
CLP_S_CORE_SOURCESvariable includes all the necessary core header files needed for the library's functionality, ensuring proper access to fundamental types and definitions.
49-54: Library correctly defined with alias for consistent referencingThe creation of the
clp_s_search_astlibrary and its aliasclp_s::search::astfollows good CMake practices, allowing for consistent referencing of the library from other parts of the project.
55-63: Dependencies properly configured with appropriate visibilityThe library configuration correctly:
- Sets the include directories and C++20 standard
- Links publicly to
clp_s::TimestampPatternwhich is used in public interfaces- Links privately to
simdjsonwhich is only used internallyThis ensures that dependencies are properly managed and exposed only when necessary.
components/core/src/clp_s/search/ast/ColumnDescriptor.hpp (3)
10-11: Include order is correct.The include order has been updated correctly to ensure proper dependency resolution. The relative path approach
../../ErrorCode.hppand../../TraceableException.hppis appropriate for the new directory structure.
14-14: Namespace update correctly reflects new code organization.The namespace has been appropriately updated to
clp_s::search::astwhich aligns with the PR objective of reorganizing the codebase structure.
308-308: Namespace closing comment is accurate.The closing namespace comment correctly reflects the full namespace path
clp_s::search::ast.components/core/src/clp_s/search/sql/sql.cpp (2)
9-10: Include paths updated correctly.The include paths have been properly updated to reflect the new location of
EmptyExpr.hppandExpression.hppin the ast subdirectory.
22-24: Using declarations added for the ast namespace.These using declarations for
EmptyExprandExpressionfrom the newclp_s::search::astnamespace help maintain clean code while adapting to the new namespace structure.components/core/src/clp_s/search/EvaluateTimestampIndex.hpp (3)
4-5: Memory header included for shared_ptr.Adding the explicit include for
<memory>is good practice since this file usesstd::shared_ptr.
8-8: Include path updated correctly.The include path has been correctly updated to reference
Expression.hppfrom its new location in the ast subdirectory.
26-26: Method signature updated to use ast namespace.The method signature for
runhas been properly updated to usestd::shared_ptr<ast::Expression>instead of the previous version, which is consistent with the namespace changes and matches the pattern used in other related classes likeAddTimestampConditions,SchemaMatch, etc. as seen in the relevant code snippets.components/core/tests/test-sql.cpp (2)
6-6: Include path updated correctly for test file.The include path has been properly updated to reference
EmptyExpr.hppfrom its new location in the ast subdirectory.
10-10: Using declaration updated to reference new namespace.The using declaration has been correctly updated to reference
EmptyExprfrom the newclp_s::search::astnamespace.components/core/src/clp_s/search/AddTimestampConditions.cpp (4)
3-10: Include paths properly updated for AST componentsThe includes have been correctly updated to reference the new
ast/directory structure, which aligns with the PR objective of creating theclp_s::search::astlibrary.
12-18: Using declarations properly added for ast namespaceThese using declarations improve code readability by eliminating the need for fully qualified names throughout the implementation. The approach maintains consistency with the restructuring objective.
22-22: Coding style follows guidelinesThe expression
false == m_begin_ts.has_value()correctly follows the coding guideline to preferfalse == <expression>rather than!<expression>.
28-28: Consistent coding style maintainedThe expression
false == m_timestamp_column.has_value()correctly follows the coding guideline to preferfalse == <expression>rather than!<expression>.components/core/src/clp_s/search/ast/StringLiteral.hpp (4)
8-8: Include path updatedThe include path has been changed from "Utils.hpp" to "SearchUtils.hpp", reflecting the refactoring of utility functions into the new namespace structure.
10-10: Namespace properly updated to the new structureThe namespace has been changed from
clp_s::searchtoclp_s::search::ast, which aligns with the PR objective of creating a dedicated AST namespace.
72-72: Function call updatedThe function call has been changed from
StringUtils::has_unescaped_wildcards(m_v)tohas_unescaped_wildcards(m_v), reflecting that this function has been moved into the current namespace or is now accessible without qualification.
77-77: Namespace closing comment updatedThe namespace closing comment has been correctly updated to reflect the new namespace structure.
components/core/src/clp_s/search/kql/CMakeLists.txt (1)
22-22: Added dependency on the new AST libraryThe kql library now depends on the new
clp_s::search::astlibrary, which is consistent with the PR's objective of splitting the code into separate libraries. This change ensures that the kql library can use types and functions from the ast namespace.components/core/src/clp_s/SchemaTree.cpp (3)
5-5: Include path updated for Literal.hppThe include path has been updated from "search/Literal.hpp" to "search/ast/Literal.hpp" to reflect the new directory structure after code reorganization.
9-9: Return type updated to use the new namespaceThe return type of the
node_to_literal_typefunction has been updated fromclp_s::search::LiteralTypetoclp_s::search::ast::LiteralTypeto align with the new namespace structure.
14-14: LiteralType enum references updated to use the ast namespaceAll references to LiteralType values have been updated to use the
clp_s::search::ast::namespace prefix. This ensures consistency with the namespace restructuring throughout the codebase.Also applies to: 16-16, 18-18, 20-20, 22-22, 24-24, 26-26, 28-28, 32-32
components/core/src/clp_s/search/sql/CMakeLists.txt (1)
21-21: Updated dependency looks correct.The addition of
clp_s::search::astas a dependency in thetarget_link_librariescommand is consistent with the PR objective of creating a newclp_s::search::astlibrary and restructuring the codebase.components/core/src/clp_s/TimestampDictionaryReader.cpp (2)
5-5: Include path updated correctly.The change in include path from "search/SearchUtils.hpp" to "search/ast/SearchUtils.hpp" properly reflects the restructuring of components into the new AST namespace.
24-30: Function call updated to use the new namespace.The call to
tokenize_column_descriptorhas been properly updated to use the newclp_s::search::astnamespace. This is consistent with the PR's objective of moving functionality to the AST namespace.The boolean comparison style (
false == expression) follows the coding guidelines.components/core/src/clp_s/search/sql/sql.hpp (2)
7-7: Include path updated correctly.The include path has been updated to reference the Expression.hpp file in its new location within the ast directory.
15-16: Return type updated with correct namespace.The return type of
parse_sql_expressionhas been updated to explicitly use theclp_s::search::ast::Expressiontype, which is appropriate given the namespace restructuring in this PR.components/core/src/clp_s/search/EvaluateTimestampIndex.cpp (5)
3-9: Include paths updated correctly.All include paths have been properly updated to reference files in their new locations within the ast directory.
10-17: Using directives added for AST types.Adding these using directives improves code readability by avoiding the need to prefix these commonly used types with their full namespace throughout the file.
19-19: Constant definition updated with correct namespace.The definition of
cDateTypeshas been correctly updated to referencesearch::ast::cIntegralTypesandsearch::ast::EpochDateTin their new namespace.
58-60: Boolean comparison follows coding guidelines.The use of
false == column->matches_any(cDateTypes)is consistent with the coding guideline preference forfalse == <expression>rather than!<expression>.
81-83: Boolean comparison follows coding guidelines.The use of
false == matchedis consistent with the coding guideline preference forfalse == <expression>rather than!<expression>.components/core/src/clp_s/SchemaTree.hpp (2)
15-15: Include path updated correctly.The include path has been correctly updated to reflect the new location of the Literal.hpp file within the ast subdirectory.
51-51: Return type updated to match new namespace structure.The return type has been properly updated to use the new namespace structure
clp_s::search::ast::LiteralType, which aligns with the PR objective of placing AST components within theclp_s::search::astnamespace.components/core/src/clp_s/search/ast/SearchUtils.cpp (5)
5-5: Appropriate include added for string_view.The addition of the string_view include is appropriate since the new function uses std::string_view as a parameter.
10-10: Include path updated correctly.The include path for archive_constants.hpp has been correctly updated to reflect the new file location in the directory structure.
12-12: Namespace updated to match new structure.The namespace has been updated to
clp_s::search::astwhich properly reflects the restructuring mentioned in the PR objectives.
137-147: Function implementation correctly relocated.The
has_unescaped_wildcardsfunction has been correctly implemented in the SearchUtils namespace, as mentioned in the PR objectives which specified relocating this function from StringUtils.The implementation follows the coding guidelines by using
'*' == str[i]instead ofstr[i] == '*', matching the preference for Yoda-style conditionals seen elsewhere in the codebase.
282-282: Namespace closing comment updated.The namespace closing comment has been correctly updated to match the new namespace structure.
components/core/tests/test-clp_s-search.cpp (5)
19-23: Include paths updated correctly.The include paths have been correctly updated to reflect the new location of headers in the ast subdirectory.
118-118: Class reference updated correctly.The reference to EmptyExpr has been properly updated to use the new namespace
clp_s::search::ast::EmptyExpr.The code also follows the coding guidelines by using
nullptr == std::dynamic_pointer_cast<...>rather thanstd::dynamic_pointer_cast<...> == nullptr.
120-120: Class reference updated correctly.The reference to OrOfAndForm has been properly updated to use the new namespace
clp_s::search::ast::OrOfAndForm.
124-124: Class reference updated correctly.The reference to NarrowTypes has been properly updated to use the new namespace
clp_s::search::ast::NarrowTypes.
128-128: Class reference updated correctly.The reference to ConvertToExists has been properly updated to use the new namespace
clp_s::search::ast::ConvertToExists.components/core/src/clp_s/search/AddTimestampConditions.hpp (4)
4-4: Standard include added.The memory include has been properly added, which is necessary for using shared_ptr.
11-12: Include paths updated correctly.The include paths have been properly updated to reference the headers from the new ast subdirectory.
24-24: Base class updated correctly.The base class has been updated from Transformation to ast::Transformation to reflect the new namespace structure.
41-41: Method signature updated correctly.The return type and parameter type have been properly updated to use std::shared_ptrast::Expression instead of std::shared_ptr, aligning with the new namespace structure.
components/core/src/clp_s/search/Projection.cpp (3)
6-6: Proper include added for the AST component.The addition of the AST-specific include directive aligns with the restructuring of the codebase and ensures proper access to the ColumnDescriptor class that has been moved to the ast namespace.
9-9: Method signature correctly updated to use the new namespace structure.The parameter type has been properly updated to use the ast namespace, which is consistent with the restructuring mentioned in the PR objectives.
37-37: Method signature correctly updated to use the new namespace structure.The parameter type for resolve_column has been properly updated to use the ast namespace, maintaining consistency with the add_column method updated earlier.
components/core/src/clp_s/CMakeLists.txt (4)
2-2: New subdirectory correctly added for AST components.The addition of the search/ast subdirectory aligns with the PR objectives of creating a dedicated namespace for AST-related components.
204-211: New source file set created for TimestampPattern.This change properly groups related files for the new TimestampPattern library, which aligns with the PR objectives.
213-224: New TimestampPattern library properly defined.The library definition includes appropriate compiler features (C++20) and dependency linking, ensuring the new library is properly integrated into the build system.
242-243: New libraries correctly linked to the clp-s executable.The clp-s executable now properly links against both new libraries (clp_s::search::ast and clp_s::TimestampPattern), ensuring access to the restructured components.
components/core/CMakeLists.txt (1)
649-650: New libraries correctly linked to unitTest.The unitTest executable now properly links against both new libraries (clp_s::search::ast and clp_s::TimestampPattern), ensuring that tests can access the restructured components.
components/core/src/clp_s/TimestampEntry.hpp (2)
12-12: Include path correctly updated for relocated FilterOperation.The include path has been updated to reflect the new location of the FilterOperation header in the ast namespace.
92-93: Method signatures correctly updated with fully qualified namespace.Both evaluate_filter method signatures have been properly updated to use the fully qualified name for FilterOperation, clearly indicating which version of the class is being used after the namespace restructuring.
components/core/src/clp_s/search/SchemaMatch.cpp (2)
9-18: Clean refactoring of header includes to utilize the new ast namespace.The includes have been properly updated to reference AST components from their new location in the ast/ directory, which aligns with the PR objective of splitting the code into a dedicated AST library.
20-32: Well-organized namespace usage with explicit using directives.The added using directives clearly indicate which AST components are being used in this file, improving code readability while maintaining the separation of concerns introduced by the new namespace structure.
components/core/src/clp_s/search/Projection.hpp (2)
10-10: Updated include directive to use the new ast namespace.The include path has been correctly updated to reference ColumnDescriptor from its new location in the ast directory.
42-42: Method signatures and member variables properly updated to use ast::ColumnDescriptor.All references to ColumnDescriptor have been updated to use the new ast namespace, ensuring consistency with the PR objective of creating a dedicated AST library. The changes to method signatures and member variables maintain the existing functionality while adhering to the new code organization.
Also applies to: 82-83, 85-85
components/core/src/clp_s/clp-s.cpp (4)
24-29: Include directives properly updated to reference the new ast namespace.The includes have been correctly updated to reference AST components from their new location, aligning with the PR objective of creating a dedicated AST library.
71-71: Function parameter type correctly updated to use ast::Expression.The function signature has been properly updated to use the new namespace, maintaining compatibility with the refactored code structure.
153-181: AST-related objects and functions consistently updated throughout the code.All references to AST components (EmptyExpr, OrOfAndForm, NarrowTypes, ConvertToExists) have been properly updated to use the ast namespace. The changes maintain functionality while adapting to the new code organization.
209-223: Function calls to AST utility functions properly updated.Calls to tokenize_column_descriptor and create_from_escaped_tokens have been correctly updated to use the ast namespace, ensuring consistency throughout the codebase.
components/core/src/clp_s/JsonParser.cpp (2)
31-32: Include directives properly updated to reference the new ast namespace.The includes have been correctly updated to reference ColumnDescriptor and SearchUtils from their new location in the ast directory, aligning with the PR objective.
95-110: Function calls updated to use the ast namespace.Calls to tokenize_column_descriptor and create_from_escaped_tokens have been properly updated to use the clp_s::search::ast namespace, ensuring consistency throughout the codebase.
components/core/tests/test-kql.cpp (2)
9-12: Includes look properly updated for new AST structure
These added include statements correctly reference the newastdirectory without any obvious issues or structural conflicts.🧰 Tools
🪛 Cppcheck (2.10-2)
[performance] 12-12: Variable 'm_previous_logging_level' is assigned in constructor body. Consider performing initialization in initialization list.
(useInitializationList)
16-20: Namespace usage aligns with the refactored codebase
Using declarations for theastnamespace appear consistent and facilitate clear references to the moved classes.components/core/src/clp_s/search/Output.cpp (3)
9-15: Correct transition to AST headers
The newly introduced headers underast/correctly reflect the new library structure.
19-29: Using directives maintain clarity
These using statements neatly clarify references to AST classes. No issues detected.
941-941: Conditional check respects project guidelines
Usingfalse == ast::has_unescaped_wildcards(query_string)follows the recommended style and integrates the new AST function cleanly.components/core/src/clp_s/search/kql/kql.cpp (5)
12-23: Includes properly reference refactored AST headers
These additions accurately point to the newastfiles with no apparent warnings.
32-45: Using statements correctly adopt theastnamespace
Standardizing these references promotes readability and eases tracking of AST classes.
93-93: Literal unescape check is straightforward
The conditionif (false == ...unescape_kql_value(...))aligns with coding guidelines.
111-111: Accurate date literal unescape
Similarly, verifyingunescape_kql_valuefor date literals matches the same pattern without issues.
132-135: Tokenization condition is clearly handled
This condition correctly verifies the outcome oftokenize_column_descriptorand is stylistically consistent with the rest of the project.lint-tasks.yml (1)
443-478: Approve namespace restructuring for AST components.The modification correctly updates the linting exclusion patterns to reflect the new file paths after the AST components were moved to the dedicated
astdirectory. This change aligns perfectly with the PR objective of restructuring the codebase to create a newclp_s::search::astnamespace.components/core/src/clp_s/search/Output.hpp (27)
17-18: Updated includes to reference the new ast namespace.The includes now correctly reference the AST components from their new location in the dedicated
astdirectory, which aligns with the codebase restructuring objective.
30-30: Updated constructor parameter type to use ast namespace.The parameter type has been properly updated to use the
ast::Expressiontype from the new namespace.
59-59: Updated member variable declaration to use ast namespace.The
m_exprmember variable has been correctly updated to use theast::Expressiontype.
79-81: Updated unordered_map declarations to use ast namespace.The mapping data structures have been properly updated to use the
ast::Expressiontype, maintaining consistency with the namespace changes throughout the file.
89-91: Updated member variables for wildcard handling to use ast namespace.The wildcard-related member variables have been correctly updated to use the
astnamespace for types likeColumnDescriptorandLiteralTypeBitmask.
95-96: Updated OpList iteration variables to use ast namespace.The expression state stack now correctly uses the
ast::OpListiterator type.
122-122: Updated evaluate method signature to use ast namespace.The method signature now correctly uses the
ast::Expressiontype, maintaining consistency with the namespace changes.
130-130: Updated evaluate_filter method signature to use ast namespace.The method signature now correctly uses the
ast::FilterExprtype from the new namespace.
138-138: Updated evaluate_wildcard_filter method signature to use ast namespace.The method signature now correctly uses the
ast::FilterExprtype, maintaining consistency with other filter evaluation methods.
148-151: Updated evaluate_int_filter method signature to use ast namespace.The method signature has been properly updated to use the
ast::FilterOperationandast::Literaltypes from the new namespace.
160-160: Updated evaluate_int_filter_core static method to use ast namespace.The method now correctly uses the
ast::FilterOperationenum from the new namespace.
169-173: Updated evaluate_float_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationandast::Literaltypes.
182-182: Updated evaluate_float_filter_core static method to use ast namespace.The method now correctly uses the
ast::FilterOperationenum from the new namespace.
191-195: Updated evaluate_clp_string_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationtype.
204-208: Updated evaluate_var_string_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationtype.
217-221: Updated evaluate_epoch_date_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationandast::Literaltypes.
231-236: Updated evaluate_array_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperation,ast::DescriptorList, andast::Literaltypes.
247-253: Updated evaluate_array_filter_value method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperation,ast::DescriptorList, andast::Literaltypes.
264-270: Updated evaluate_array_filter_array method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperation,ast::DescriptorList, andast::Literaltypes.
281-287: Updated evaluate_array_filter_object method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperation,ast::DescriptorList, andast::Literaltypes.
296-300: Updated evaluate_wildcard_array_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationandast::Literaltypes.
309-313: Updated array-specific evaluate_wildcard_array_filter overload to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationandast::Literaltypes.
322-326: Updated object-specific evaluate_wildcard_array_filter overload to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationandast::Literaltypes.
335-339: Updated evaluate_bool_filter method to use ast namespace.The method parameters have been properly updated to use the
ast::FilterOperationandast::Literaltypes.
345-345: Updated populate_string_queries method to use ast namespace.The method parameter has been properly updated to use the
ast::Expressiontype.
359-360: Updated constant_propagate method to use ast namespace.The method signature has been properly updated to use the
ast::Expressiontype.
366-366: Updated populate_searched_wildcard_columns method to use ast namespace.The method parameter has been properly updated to use the
ast::Expressiontype.components/core/src/clp_s/search/SchemaMatch.hpp (14)
10-14: Updated includes to reference components from the ast namespace.The includes now correctly reference AST components from their new location in the
astdirectory, which aligns with the codebase restructuring objective.
17-17: Updated class inheritance to use ast namespace.The SchemaMatch class now correctly inherits from
ast::Transformationinstead of justTransformation, maintaining the inheritance relationship after the namespace change.
27-27: Updated run method signature to use ast namespace.The method signature now correctly uses the
ast::Expressiontype for both return value and parameter.
33-33: Updated get_query_for_schema method signature to use ast namespace.The method signature now correctly uses the
ast::Expressiontype for the return value.
72-79: Updated member variables to use ast namespace.All member variables related to column descriptors and expressions have been properly updated to use the appropriate types from the
astnamespace.
82-82: Updated schema_to_query map to use ast namespace.The map now correctly uses
ast::Expressionas the value type.
94-94: Updated populate_column_mapping method signature to use ast namespace.The method parameter has been properly updated to use the
ast::ColumnDescriptortype.
101-101: Updated overloaded populate_column_mapping method to use ast namespace.The method parameter has been properly updated to use the
ast::ColumnDescriptortype, maintaining consistency with the other overload.
108-108: Updated expression-based populate_column_mapping method to use ast namespace.Both the parameter and return type have been properly updated to use the
ast::Expressiontype.
120-120: Updated intersect_schemas method to use ast namespace.Both the parameter and return type have been properly updated to use the
ast::Expressiontype.
130-135: Updated intersect_and_sub_expr method to use ast namespace.The method parameters have been properly updated to use the
ast::Expressionandast::ColumnDescriptortypes.
143-146: Updated split_expression_by_schema method to use ast namespace.The method parameters have been properly updated to use the
ast::Expressiontype consistently.
154-154: Updated get_column_id_for_descriptor method to use ast namespace.The method parameter has been properly updated to use the
ast::ColumnDescriptortype.
161-161: Updated get_literal_type_for_column method to use ast namespace.The method parameter and return type have been properly updated to use the
ast::ColumnDescriptorandast::LiteralTypetypes respectively.
wraymo
left a comment
There was a problem hiding this comment.
Thanks for the refactoring. I'm generally fine with the changes. Just two questions:
-
Since we're moving timestamp patterns into a separate library, do we still want to create
TimestampPatternGlobalInstance? What's the benefit of having a separate library here? -
Could we document somewhere what
astrefers to? I'm not sure if that's clear enough.
| return false; | ||
| } | ||
|
|
||
| bool StringUtils::has_unescaped_wildcards(std::string const& str) { |
There was a problem hiding this comment.
Is it because it's related to escaping so we move it to SearchUtils?
There was a problem hiding this comment.
It's because it is used by StringLiteral. Moving it into SearchUtils allows the ast library to not depend on Utils.
|
|
||
| // Skip decompressing archive if it won't match based on the timestamp | ||
| // range index | ||
| EvaluateTimestampIndex timestamp_index(m_archive_reader->get_timestamp_dictionary()); |
There was a problem hiding this comment.
Are we checking the index elsewhere?
There was a problem hiding this comment.
Yeah, we check it in the main flow before schema matching if you check clp-s.cpp.
I took it out because I thought it was a leftover from when we had sub-archives, but now I'm realizing that the reason we have this duplicated check here is because ambiguous columns can get resolved to the timestamp column after column resolution.
I will add it back.
For 1 I was trying to make it more obvious that users of the ast library should call For 2 I can add a comment in the |
I pushed the changes that I described. I can get rid of the TimestampPattern library or not depending on what you decide. |
kirkrodrigues
left a comment
There was a problem hiding this comment.
Approving changes external to components/core/src/clp_s.
Edited PR title slightly to be grammatically correct and follow our convention of finishing PR titles with a period.
… clp_s::TimestampPattern libraries. (y-scope#790)
Description
This PR splits up the clp-s build and introduces the clp_s::search::ast and clp_s:TimestampPattern libraries.
The diff is deceptively large, but contains (almost) no real code change. Mostly this PR consists of:
Checklist
breaking change.
Validation performed
Summary by CodeRabbit
Summary by CodeRabbit