Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse folded POINT geometries from QLever IDs dynamically #19

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/qlever-petrimaps/GeomCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
} else if ((p = _dangling.rfind("POINT(", 1)) != std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parseMultiPoint(_dangling, p + 4, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
IdMapping idm{0, std::numeric_limits<ID_TYPE>::max()};
_lastQidToId = idm;
_qidToIdF.write(reinterpret_cast<const char *>(&idm),
sizeof(IdMapping));
_qidToIdFSize++;
}
// _curUniqueGeom++;
// size_t i = 0;
// p = parseMultiPoint(_dangling, p + 4, std::string::npos, &i);

// // dummy element to keep sync
// if (i == 0) {
// IdMapping idm{0, std::numeric_limits<ID_TYPE>::max()};
// _lastQidToId = idm;
// _qidToIdF.write(reinterpret_cast<const char *>(&idm),
// sizeof(IdMapping));
// _qidToIdFSize++;
// }
} else if ((p = _dangling.rfind("MULTIPOINT(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
Expand Down Expand Up @@ -409,6 +409,10 @@ void GeomCache::parseIds(const char *c, size_t size) {
<< " points), " << _geometryDuplicates << " duplicates)";
}

uint8_t type = (_curId.val & (uint64_t(15) << 60)) >> 60;

if (type == 8) continue;

if (_curIdRow < _qidToId.size() && _qidToId[_curIdRow].qid == 0) {
// if we have two consecutive and equivalent QLever ids, the geometry
// was returned multiple times in the fill query. This can happen if the
Expand Down
Loading
Loading