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

Assertion !dpTab[k - 1].empty() failed in QueryPlanner.cpp #1487

Open
dpriskorn opened this issue Sep 7, 2024 · 5 comments
Open

Assertion !dpTab[k - 1].empty() failed in QueryPlanner.cpp #1487

dpriskorn opened this issue Sep 7, 2024 · 5 comments

Comments

@dpriskorn
Copy link

image
https://qlever.cs.uni-freiburg.de/wikidata/9IJGud
Assertion !dpTab[k - 1].empty() failed. Please report this to the developers. In file "/local/data-ssd/qlever/qlever-code/src/engine/QueryPlanner.cpp " at line 1228

@hannahbast
Copy link
Member

hannahbast commented Sep 7, 2024

@dpriskorn Thanks for pointing that out to us. The query is impossibly hard (the inner query is a cross-product of the whole index with itself, with a result size of around 1 quintillion, that is 1000 billion billion). But, of course, it should not produce an assertion failure.

May I ask what you intended to do with this query? You gave the variables names which suggest a certain semantics. But without associating these variables with any predicates or entities, they are just free variables that match everything.

@tuukka
Copy link

tuukka commented Sep 7, 2024

Here's a much easier query that should give the wanted result (based on the variable names), but it runs out of memory when I try to run it: https://qlever.cs.uni-freiburg.de/wikidata/c0KH0F

PREFIX prov: <http://www.w3.org/ns/prov#>
SELECT (COUNT(DISTINCT ?item) AS ?itemsWithReferencedStatements) 
WHERE { 
    ?item ?property ?statement.
    ?statement prov:wasDerivedFrom ?reference.
}

@hannahbast
Copy link
Member

hannahbast commented Sep 7, 2024

@tuukka I agree it's easier than computing a join between two tables of size 30 billion, but it's still a join between a table of size 30 billion (all triples matching ?item ?property ?statement) and a table of size 1 billion (all triples matching ?statement prov:wasDerivedFrom ?reference). With the "lazy group by", "lazy join", etc. that we are currently working on, this will also work with limited RAM, but it's still a very costly query, which will take a long time to process.

@tuukka
Copy link

tuukka commented Sep 9, 2024

Here's a query that avoids the join and the 30 billion triple table, but it still runs out of memory: https://qlever.cs.uni-freiburg.de/wikidata/MpDkiF

PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wds: <http://www.wikidata.org/entity/statement/>

SELECT (COUNT(DISTINCT ?item) AS ?itemsWithReferencedStatements) 
WHERE {
    ?statement prov:wasDerivedFrom ?reference.
    BIND(STRAFTER(STRBEFORE(STR(?statement), "-"), STR(wds:)) AS ?item)
}

@hannahbast hannahbast changed the title Fatal error in QueryPlanner.cpp Assertion !dpTab[k - 1].empty() failed in QueryPlanner.cpp Sep 9, 2024
@joka921
Copy link
Member

joka921 commented Sep 30, 2024

@dpriskorn Thanks for reporting this,
As I also recently stumbled upon this issue, I can share some details:
This assertion is triggered as soon as you require a full join of the index with itself (at least two variables with three triples each).
QLever currently refuses to compute such queries (they typically run out of memory anyway), but of course such queries should either work or give a human-readable error, but shouldn't leak an internal Assertion. I will think about what to do
(The trivial fix of "just allowing it" broke some unit tests, which should be easy to fix when I have some time for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants