Skip to content

Commit

Permalink
Force deterministic query plan for query in E2E test (#488)
Browse files Browse the repository at this point in the history
By putting a part of the query in a subquery, we enforce a particular query plan. Without that, different runs for the same query produced different query plans.
  • Loading branch information
joka921 committed Sep 27, 2021
1 parent e5b9201 commit 3b9bba0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions e2e/scientists_queries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,14 @@ queries:
- contains_row: ['<Carl_Sagan>', '<Astrobiologist>', 1.8, 1.8]
- query : filter-on-variable-columns
type: no-text
# The inner subquery is for making the SAMPLE() deterministic
sparql: |
SELECT ?p (SAMPLE(?a) as ?a1) (SAMPLE(?a) as ?a2) (SAMPLE(?a) as ?a3) (SAMPLE(?a) as ?a4) (AVG(?h) as ?avg) WHERE {
?a <Height> ?h .
?a <Profession> ?p .
{ SELECT ?a ?h ?p WHERE {
?a <Height> ?h .
?a <Profession> ?p .
} ORDER BY ASC(?p) DESC(?h)
}
}
GROUP BY ?p
HAVING (?avg > 1.8)
Expand Down Expand Up @@ -878,5 +882,3 @@ queries:
- selected: [ "?x", "?y", "?sum" ]
- contains_row: [ "<Albert_Einstein>", "<Mileva_Marić>", 42.0 ]
- order_string: { "dir": "ASC", "var": "?x" }


0 comments on commit 3b9bba0

Please sign in to comment.