You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a HAVING clause, it should not be required for the expressions around AND or OR operators to be surrounded by parentheses.
To illustrate, nowadays the following query in BQL works:
SELECT ?parent_name, ?child_name, ?child_height
FROM ?family
WHERE {
?parent ID ?parent_name "parent_of"@[] ?child ID ?child_name .
?child "height_cm"@[] ?child_height
}
HAVING (?child_height > "150"^^type:int64) AND (?parent = /u<peter>);
But the following does not:
SELECT ?parent_name, ?child_name, ?child_height
FROM ?family
WHERE {
?parent ID ?parent_name "parent_of"@[] ?child ID ?child_name .
?child "height_cm"@[] ?child_height
}
HAVING ?child_height > "150"^^type:int64 AND ?parent = /u<peter>;
It yields the following error:
[FAIL] [ERROR] Failed to parse BQL statement with error Parser.parse: Failed to consume symbol HAVING, with error failed to consume all token; left over [{false 0xc00021af50} {false 0xc00021afa0} {false 0xc00021aff0} {false 0xc00021b040}]
This may be related with the NewEvaluator inside expression.go in semantics, as the grammar is not the one restricting this behavior.
You can use the code in the file below to reproduce the aforementioned results.
When using a HAVING clause, it should not be required for the expressions around AND or OR operators to be surrounded by parentheses.
To illustrate, nowadays the following query in BQL works:
But the following does not:
It yields the following error:
This may be related with the
NewEvaluator
insideexpression.go
in semantics, as the grammar is not the one restricting this behavior.You can use the code in the file below to reproduce the aforementioned results.
parentheses_in_having.pdf
The text was updated successfully, but these errors were encountered: