diff --git a/src/index/CompressedRelation.h b/src/index/CompressedRelation.h index 08198c834..c59c4a025 100644 --- a/src/index/CompressedRelation.h +++ b/src/index/CompressedRelation.h @@ -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 blockIndex_; + size_t blockIndex_; }; // Serialization of the `OffsetAndcompressedSize` subclass. diff --git a/test/CompressedRelationsTest.cpp b/test/CompressedRelationsTest.cpp index 2e447d76c..9233cbd1b 100644 --- a/test/CompressedRelationsTest.cpp +++ b/test/CompressedRelationsTest.cpp @@ -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; @@ -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; @@ -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; @@ -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}; @@ -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; diff --git a/test/IndexMetaDataTest.cpp b/test/IndexMetaDataTest.cpp index cc3c5447a..fa6bc07a8 100644 --- a/test/IndexMetaDataTest.cpp +++ b/test/IndexMetaDataTest.cpp @@ -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}; @@ -48,19 +48,19 @@ TEST(IndexMetaDataTest, writeReadTest2Mmap) { std::string mmapFilename = imdFilename + ".mmap"; vector 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}; diff --git a/test/LocatedTriplesTest.cpp b/test/LocatedTriplesTest.cpp index 725582e8b..c4364023f 100644 --- a/test/LocatedTriplesTest.cpp +++ b/test/LocatedTriplesTest.cpp @@ -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 =