Skip to content

Commit c79d25f

Browse files
committed
I think I've got it.
But we still have to clean up a lot of stuff.
1 parent a2e0265 commit c79d25f

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

src/engine/idTable/CompressedExternalIdTable.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class CompressedExternalIdTableBase {
333333
AD_CONTRACT_CHECK(NumStaticCols == 0 || NumStaticCols == numCols);
334334
}
335335
// TODO<joka921> Shouldn't be public.
336-
std::atomic<bool> isFirstMerge = true;
336+
std::atomic<bool> isFirstMerge = true;
337337
// Add a single row to the input. The type of `row` needs to be something that
338338
// can be `push_back`ed to a `IdTable`.
339339
void push(const auto& row) requires requires { currentBlock_.push_back(row); }
@@ -417,7 +417,7 @@ class CompressedExternalIdTableBase {
417417
if (numBlocksPushed_ == 0) {
418418
AD_CORRECTNESS_CHECK(this->numElementsPushed_ ==
419419
this->currentBlock_.size());
420-
blockTransformation_(this->currentBlock_);
420+
blockTransformation_(this->currentBlock_);
421421
return false;
422422
}
423423
pushBlock(std::move(this->currentBlock_));
@@ -645,10 +645,12 @@ class CompressedExternalIdTableSorter
645645
const auto& block = this->currentBlock_;
646646
const auto blocksizeOutput = blocksize.value_or(block.numRows());
647647
if (block.numRows() <= blocksizeOutput) {
648-
// TODO<joka921> We don't need the copy if we only want to iterate once, make this configurable.
649-
auto blockAsStatic = IdTableStatic<N>(this->currentBlock_.clone().template toStatic<N>());
648+
// TODO<joka921> We don't need the copy if we only want to iterate once,
649+
// make this configurable.
650+
auto blockAsStatic = IdTableStatic<N>(
651+
this->currentBlock_.clone().template toStatic<N>());
650652
co_yield blockAsStatic;
651-
//co_yield std::move(this->currentBlock_).template toStatic<N>();
653+
// co_yield std::move(this->currentBlock_).template toStatic<N>();
652654
} else {
653655
for (size_t i = 0; i < block.numRows(); i += blocksizeOutput) {
654656
size_t upper = std::min(i + blocksizeOutput, block.numRows());
@@ -764,4 +766,4 @@ class CompressedExternalIdTableSorter
764766
};
765767
} // namespace ad_utility
766768

767-
#endif // QLEVER_COMPRESSEDEXTERNALIDTABLE_H
769+
#endif // QLEVER_COMPRESSEDEXTERNALIDTABLE_H

src/index/IndexImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,8 @@ void IndexImpl::createFromOnDiskIndex(const string& onDiskBase) {
757757
totalVocabularySize_ = vocab_.size() + vocab_.getExternalVocab().size();
758758
LOG(DEBUG) << "Number of words in internal and external vocabulary: "
759759
<< totalVocabularySize_ << std::endl;
760-
pso_.loadFromDisk(onDiskBase_, false, usePatterns());
761-
pos_.loadFromDisk(onDiskBase_, false, usePatterns());
760+
pso_.loadFromDisk(onDiskBase_, false, !usePatterns());
761+
pos_.loadFromDisk(onDiskBase_, false, !usePatterns());
762762

763763
if (loadAllPermutations_) {
764764
ops_.loadFromDisk(onDiskBase_);

src/index/Permutation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Permutation::Permutation(Enum permutation, Allocator allocator,
2222

2323
// _____________________________________________________________________
2424
void Permutation::loadFromDisk(const std::string& onDiskBase,
25-
bool onlyLoadAdditional, bool dontLoadAdditional) {
25+
bool onlyLoadAdditional,
26+
bool dontLoadAdditional) {
2627
if (!onlyLoadAdditional) {
2728
if constexpr (MetaData::_isMmapBased) {
2829
meta_.setup(onDiskBase + ".index" + fileSuffix_ + MMAP_FILE_SUFFIX,

src/index/Permutation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class Permutation {
5959
// everything that has to be done when reading an index from disk
6060
// TODO<joka921> Why do we need the second argument.
6161
void loadFromDisk(const std::string& onDiskBase,
62-
bool onlyLoadAdditional = false, bool dontLoadAdditional = false);
62+
bool onlyLoadAdditional = false,
63+
bool dontLoadAdditional = false);
6364

6465
// For a given ID for the col0, retrieve all IDs of the col1 and col2.
6566
// If `col1Id` is specified, only the col2 is returned for triples that

test/HasPredicateScanTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,4 @@ TEST(CountAvailablePredicates, patternTrickTest) {
363363
ASSERT_EQ(Int(3u), result[4][1]);
364364
}
365365

366-
#endif
366+
#endif

test/IndexTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ TEST(CreatePatterns, createPatterns) {
194194
"<a2> <d> <c2> .";
195195

196196
const Index& indexNoImpl = getQec(kb)->getIndex();
197-
//const IndexImpl& index = indexNoImpl.getImpl();
197+
// const IndexImpl& index = indexNoImpl.getImpl();
198198

199199
auto getId = ad_utility::testing::makeGetId(indexNoImpl);
200200
// Pattern p0 (for subject <a>) consists of <b> and <b2)

0 commit comments

Comments
 (0)