Skip to content

Commit

Permalink
Optimize additional includes
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTF committed Feb 10, 2025
1 parent 4fb267f commit 1722daa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 25 deletions.
10 changes: 2 additions & 8 deletions src/engine/OptionalJoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,8 @@ class OptionalJoin : public Operation {
return {_left.get(), _right.get()};
}

/**
* @brief Joins two result tables on any number of columns, inserting the
* special value ID_NO_VALUE for any entries marked as optional.
* @param a
* @param b
* @param joinColumns
* @param result
*/
// Joins two result tables on any number of columns, inserting the special
// value `Id::makeUndefined()` for any entries marked as optional.
void optionalJoin(
const IdTable& left, const IdTable& right,
const std::vector<std::array<ColumnIndex, 2>>& joinColumns,
Expand Down
4 changes: 1 addition & 3 deletions src/engine/QueryExecutionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <global/RuntimeParameters.h>

#include <memory>
#include <string>

Expand All @@ -15,11 +13,11 @@
#include "engine/RuntimeInformation.h"
#include "engine/SortPerformanceEstimator.h"
#include "global/Id.h"
#include "global/RuntimeParameters.h"
#include "index/DeltaTriples.h"
#include "index/Index.h"
#include "util/Cache.h"
#include "util/ConcurrentCache.h"
#include "util/Synchronized.h"

// The value of the `QueryResultCache` below. It consists of a `Result` together
// with its `RuntimeInfo`.
Expand Down
6 changes: 1 addition & 5 deletions src/global/Id.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
// Author: Björn Buchhold ([email protected])
#pragma once

#include <absl/strings/str_cat.h>

#include <cstdint>
#include <limits>

#include "global/ValueId.h"
#include "util/Exception.h"

using Id = ValueId;
typedef uint16_t Score;
using Score = uint16_t;

// TODO<joka921> Make the following ID and index types strong.
using ColumnIndex = uint64_t;
Expand Down
4 changes: 2 additions & 2 deletions src/index/VocabularyMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ struct VocabularyMetaData {
bool contains(Id id) const { return begin_ <= id && id < end_; }

private:
Id begin_ = ID_NO_VALUE;
Id end_ = ID_NO_VALUE;
Id begin_ = Id::makeUndefined();
Id end_ = Id::makeUndefined();
std::string prefix_;
bool beginWasSeen_ = false;
};
Expand Down
1 change: 0 additions & 1 deletion src/util/AllocatorWithLimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <absl/strings/str_cat.h>

#include <atomic>
#include <functional>
#include <memory>

Expand Down
12 changes: 6 additions & 6 deletions test/GroupByTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ TEST_F(GroupByTest, doGroupBy) {
ASSERT_EQ(123u, outTable._data[1][9]);
ASSERT_EQ(0u, outTable._data[2][9]);
ASSERT_EQ(ID_NO_VALUE, outTable._data[0][10]);
ASSERT_EQ(ID_NO_VALUE, outTable._data[1][10]);
ASSERT_EQ(ID_NO_VALUE, outTable._data[2][10]);
ASSERT_EQ(Id::makeUndefined(), outTable._data[0][10]);
ASSERT_EQ(Id::makeUndefined(), outTable._data[1][10]);
ASSERT_EQ(Id::makeUndefined(), outTable._data[2][10]);
std::memcpy(&buffer, &outTable._data[0][11], sizeof(float));
ASSERT_FLOAT_EQ(-3, buffer);
Expand All @@ -283,9 +283,9 @@ TEST_F(GroupByTest, doGroupBy) {
ASSERT_EQ(41223u, outTable._data[1][13]);
ASSERT_EQ(41223u, outTable._data[2][13]);
ASSERT_EQ(ID_NO_VALUE, outTable._data[0][14]);
ASSERT_EQ(ID_NO_VALUE, outTable._data[1][14]);
ASSERT_EQ(ID_NO_VALUE, outTable._data[2][14]);
ASSERT_EQ(Id::makeUndefined(), outTable._data[0][14]);
ASSERT_EQ(Id::makeUndefined(), outTable._data[1][14]);
ASSERT_EQ(Id::makeUndefined(), outTable._data[2][14]);
std::memcpy(&buffer, &outTable._data[0][15], sizeof(float));
ASSERT_FLOAT_EQ(2, buffer);
Expand Down

0 comments on commit 1722daa

Please sign in to comment.