Skip to content

Commit

Permalink
Merge pull request #323 from joka921/f.parsedQueryRefactor
Browse files Browse the repository at this point in the history
Refactoring the `ParsedQuery` class
  • Loading branch information
floriankramer committed Apr 24, 2020
2 parents ec8c914 + 40d9b12 commit 03777b6
Show file tree
Hide file tree
Showing 9 changed files with 571 additions and 749 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif()
endif()

## Build targets for address sanitizer
# AddressSanitize
set(CMAKE_C_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
FORCE)

###############################################################################
##### Essential settings #####
###############################################################################
Expand Down Expand Up @@ -124,6 +135,7 @@ message(STATUS "CXX_FLAGS are : " ${CMAKE_CXX_FLAGS})
message(STATUS "CXX_FLAGS_RELEASE are : " ${CMAKE_CXX_FLAGS_RELEASE})
message(STATUS "CXX_FLAGS_DEBUG are : " ${CMAKE_CXX_FLAGS_DEBUG})
message(STATUS "IMPORTANT: Make sure you have selected the desired CMAKE_BUILD_TYPE")
message(STATUS "CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
message(STATUS ---)

###############################################################################
Expand Down
408 changes: 197 additions & 211 deletions src/engine/QueryPlanner.cpp

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions src/engine/QueryPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ class QueryPlanner {
void addAllNodes(uint64_t otherNodes);
};

TripleGraph createTripleGraph(
std::shared_ptr<const ParsedQuery::GraphPattern> pattern) const;
TripleGraph createTripleGraph(const ParsedQuery::GraphPattern* pattern) const;

static ad_utility::HashMap<string, size_t>
createVariableColumnsMapForTextOperation(
Expand Down Expand Up @@ -190,8 +189,7 @@ class QueryPlanner {

bool _enablePatternTrick;

std::vector<SubtreePlan> optimize(
std::shared_ptr<const ParsedQuery::GraphPattern> pattern);
std::vector<SubtreePlan> optimize(ParsedQuery::GraphPattern* rootPattern);

/**
* @brief Fills varToTrip with a mapping from all variables in the root graph
Expand Down Expand Up @@ -252,9 +250,8 @@ class QueryPlanner {
std::string generateUniqueVarName();

// Creates a tree of unions with the given patterns as the trees leaves
std::shared_ptr<ParsedQuery::GraphPattern> uniteGraphPatterns(
const std::vector<std::shared_ptr<ParsedQuery::GraphPattern>>& patterns)
const;
ParsedQuery::GraphPattern uniteGraphPatterns(
std::vector<ParsedQuery::GraphPattern>&& patterns) const;

/**
* @brief Merges two rows of the dp optimization table using various types of
Expand Down

0 comments on commit 03777b6

Please sign in to comment.