Skip to content

Commit

Permalink
Fix the compilation.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <[email protected]>
  • Loading branch information
joka921 committed Oct 22, 2024
1 parent 95bbbeb commit 74391ab
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/index/CompressedRelation.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct CompressedBlockMetadata : CompressedBlockMetadataNoBlockIndex {
// The index of this block in the permutation. This is required to find
// the corresponding block from the `LocatedTriples` when only a subset of
// blocks is being used.
std::optional<size_t> blockIndex_;
size_t blockIndex_;
};

// Serialization of the `OffsetAndcompressedSize` subclass.
Expand Down
34 changes: 18 additions & 16 deletions test/CompressedRelationsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,11 @@ TEST(CompressedRelationMetadata, GettersAndSetters) {

TEST(CompressedRelationReader, getBlocksForJoinWithColumn) {
CompressedBlockMetadata block1{
{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false, 0};
{{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false}, 0};
CompressedBlockMetadata block2{
{}, 0, {V(42), V(3), V(0), g}, {V(42), V(4), V(12), g}, {}, false, 1};
{{}, 0, {V(42), V(3), V(0), g}, {V(42), V(4), V(12), g}, {}, false}, 1};
CompressedBlockMetadata block3{
{}, 0, {V(42), V(4), V(13), g}, {V(42), V(6), V(9), g}, {}, false, 2};
{{}, 0, {V(42), V(4), V(13), g}, {V(42), V(6), V(9), g}, {}, false}, 2};

// We are only interested in blocks with a col0 of `42`.
CompressedRelationMetadata relation;
Expand Down Expand Up @@ -550,15 +550,16 @@ TEST(CompressedRelationReader, getBlocksForJoinWithColumn) {
}
TEST(CompressedRelationReader, getBlocksForJoin) {
CompressedBlockMetadata block1{
{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false, 0};
{{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false}, 0};
CompressedBlockMetadata block2{
{}, 0, {V(42), V(3), V(0), g}, {V(42), V(4), V(12), g}, {}, false, 1};
{{}, 0, {V(42), V(3), V(0), g}, {V(42), V(4), V(12), g}, {}, false}, 1};
CompressedBlockMetadata block3{
{}, 0, {V(42), V(5), V(13), g}, {V(42), V(8), V(9), g}, {}, false, 2};
{{}, 0, {V(42), V(5), V(13), g}, {V(42), V(8), V(9), g}, {}, false}, 2};
CompressedBlockMetadata block4{
{}, 0, {V(42), V(8), V(16), g}, {V(42), V(20), V(9), g}, {}, false, 3};
{{}, 0, {V(42), V(8), V(16), g}, {V(42), V(20), V(9), g}, {}, false}, 3};
CompressedBlockMetadata block5{
{}, 0, {V(42), V(20), V(16), g}, {V(42), V(20), V(63), g}, {}, false, 4};
{{}, 0, {V(42), V(20), V(16), g}, {V(42), V(20), V(63), g}, {}, false},
4};

// We are only interested in blocks with a col0 of `42`.
CompressedRelationMetadata relation;
Expand All @@ -572,17 +573,18 @@ TEST(CompressedRelationReader, getBlocksForJoin) {
firstAndLastTriple};

CompressedBlockMetadata blockB1{
{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false, 0};
{{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false}, 0};
CompressedBlockMetadata blockB2{
{}, 0, {V(47), V(3), V(0), g}, {V(47), V(6), V(12), g}, {}, false, 1};
{{}, 0, {V(47), V(3), V(0), g}, {V(47), V(6), V(12), g}, {}, false}, 1};
CompressedBlockMetadata blockB3{
{}, 0, {V(47), V(7), V(13), g}, {V(47), V(9), V(9), g}, {}, false, 2};
{{}, 0, {V(47), V(7), V(13), g}, {V(47), V(9), V(9), g}, {}, false}, 2};
CompressedBlockMetadata blockB4{
{}, 0, {V(47), V(38), V(7), g}, {V(47), V(38), V(8), g}, {}, false, 3};
{{}, 0, {V(47), V(38), V(7), g}, {V(47), V(38), V(8), g}, {}, false}, 3};
CompressedBlockMetadata blockB5{
{}, 0, {V(47), V(38), V(9), g}, {V(47), V(38), V(12), g}, {}, false, 4};
{{}, 0, {V(47), V(38), V(9), g}, {V(47), V(38), V(12), g}, {}, false}, 4};
CompressedBlockMetadata blockB6{
{}, 0, {V(47), V(38), V(13), g}, {V(47), V(38), V(15), g}, {}, false, 5};
{{}, 0, {V(47), V(38), V(13), g}, {V(47), V(38), V(15), g}, {}, false},
5};

// We are only interested in blocks with a col0 of `42`.
CompressedRelationMetadata relationB;
Expand Down Expand Up @@ -662,7 +664,7 @@ TEST(CompressedRelationReader, PermutedTripleToString) {
TEST(CompressedRelationReader, filterDuplicatesAndGraphs) {
auto table = makeIdTableFromVector({{3}, {4}, {5}});
CompressedBlockMetadata metadata{
{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false, 0};
{{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false}, 0};
using Filter = CompressedRelationReader::FilterDuplicatesAndGraphs;
ScanSpecification::Graphs graphs = std::nullopt;
Filter f{graphs, 43, false};
Expand Down Expand Up @@ -699,7 +701,7 @@ TEST(CompressedRelationReader, filterDuplicatesAndGraphs) {

TEST(CompressedRelationReader, makeCanBeSkippedForBlock) {
CompressedBlockMetadata metadata{
{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false, 0};
{{}, 0, {V(16), V(0), V(0), g}, {V(38), V(4), V(12), g}, {}, false}, 0};

using Graphs = ScanSpecification::Graphs;
Graphs graphs = std::nullopt;
Expand Down
36 changes: 18 additions & 18 deletions test/IndexMetaDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Id g = V(123405);
} // namespace

TEST(RelationMetaDataTest, writeReadTest) {
CompressedBlockMetadata rmdB{{{12, 34}, {46, 11}},
5,
{V(0), V(2), V(13), g},
{V(3), V(24), V(62), g},
std::vector{V(85)},
true,
CompressedBlockMetadata rmdB{{{{12, 34}, {46, 11}},
5,
{V(0), V(2), V(13), g},
{V(3), V(24), V(62), g},
std::vector{V(85)},
true},
1039};
CompressedRelationMetadata rmdF{V(1), 3, 2.0, 42.0, 16};

Expand All @@ -48,19 +48,19 @@ TEST(IndexMetaDataTest, writeReadTest2Mmap) {
std::string mmapFilename = imdFilename + ".mmap";
vector<CompressedBlockMetadata> bs;
// A value for the Graph Id.
bs.push_back(CompressedBlockMetadata{{{12, 34}, {42, 17}},
5,
{V(0), V(2), V(13), g},
{V(2), V(24), V(62), g},
std::vector{V(512)},
true,
bs.push_back(CompressedBlockMetadata{{{{12, 34}, {42, 17}},
5,
{V(0), V(2), V(13), g},
{V(2), V(24), V(62), g},
std::vector{V(512)},
true},
17});
bs.push_back(CompressedBlockMetadata{{{12, 34}, {16, 12}},
5,
{V(0), V(2), V(13), g},
{V(3), V(24), V(62), g},
{},
false,
bs.push_back(CompressedBlockMetadata{{{{12, 34}, {16, 12}},
5,
{V(0), V(2), V(13), g},
{V(3), V(24), V(62), g},
{},
false},
18});
CompressedRelationMetadata rmdF{V(1), 3, 2.0, 42.0, 16};
CompressedRelationMetadata rmdF2{V(2), 5, 3.0, 43.0, 10};
Expand Down
4 changes: 2 additions & 2 deletions test/LocatedTriplesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ auto PT = [](const auto& c1, const auto& c2, const auto& c3, int graph = g) {
};
auto CBM = [](const auto firstTriple, const auto lastTriple) {
size_t dummyBlockIndex = 0;
return CompressedBlockMetadata{{}, 0, firstTriple, lastTriple,
{}, false, dummyBlockIndex};
return CompressedBlockMetadata{{{}, 0, firstTriple, lastTriple, {}, false},
dummyBlockIndex};
};

auto numBlocks =
Expand Down

0 comments on commit 74391ab

Please sign in to comment.