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

Several testsuite tests flagging lots of assertions in algebra.Var.setParentNode(Var.java:112) #4169

Closed
nguyenm100 opened this issue Sep 9, 2022 · 10 comments
Labels
cannot reproduce issue can not be reproduced (close reason)

Comments

@nguyenm100
Copy link
Contributor

nguyenm100 commented Sep 9, 2022

Current Behavior

SPARQLQueryTest, SPARQLUpdateTest, ComplexSPARQLQueryText, W3CApprovedSPARQL11QueryTest

~15 tests are failing as a result of some variant of this.

Some stacks:

java.lang.AssertionError
at org.eclipse.rdf4j.query.algebra.Var.setParentNode(Var.java:112)
at org.eclipse.rdf4j.query.algebra.BinaryValueOperator.setLeftArg(BinaryValueOperator.java:70)
at org.eclipse.rdf4j.query.algebra.BinaryValueOperator.(BinaryValueOperator.java:46)
at org.eclipse.rdf4j.query.algebra.SameTerm.(SameTerm.java:26)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.CompareOptimizer$CompareVisitor.meet(CompareOptimizer.java:59)
at org.eclipse.rdf4j.query.algebra.Compare.visit(Compare.java:89)
at org.eclipse.rdf4j.query.algebra.Filter.visitChildren(Filter.java:77)

java.lang.AssertionError
at org.eclipse.rdf4j.query.algebra.Var.setParentNode(Var.java:112)
at org.eclipse.rdf4j.query.algebra.FunctionCall.addArg(FunctionCall.java:92)
at org.eclipse.rdf4j.query.algebra.FunctionCall.addArgs(FunctionCall.java:79)
at org.eclipse.rdf4j.query.algebra.FunctionCall.(FunctionCall.java:48)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.RegexAsStringFunctionOptimizer$RegexAsStringFunctionVisitor.containsCandidate(RegexAsStringFunctionOptimizer.java:77)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.RegexAsStringFunctionOptimizer$RegexAsStringFunctionVisitor.meet(RegexAsStringFunctionOptimizer.java:68)
at org.eclipse.rdf4j.query.algebra.Regex.visit(Regex.java:71)
at org.eclipse.rdf4j.query.algebra.BinaryValueOperator.visitChildren(BinaryValueOperator.java:96)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetNode(AbstractQueryModelVisitor.java:576)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetBinaryValueOperator(AbstractQueryModelVisitor.java:545)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meet(AbstractQueryModelVisitor.java:118)
at org.eclipse.rdf4j.query.algebra.And.visit(And.java:35)

java.lang.AssertionError
at org.eclipse.rdf4j.query.algebra.Var.setParentNode(Var.java:112)
at org.eclipse.rdf4j.query.algebra.StatementPattern.(StatementPattern.java:101)
at org.eclipse.rdf4j.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1486)
at org.eclipse.rdf4j.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:237)
at org.eclipse.rdf4j.query.parser.sparql.ast.ASTPathElt.jjtAccept(ASTPathElt.java:32)
at org.eclipse.rdf4j.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1411)
at org.eclipse.rdf4j.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:237)
at org.eclipse.rdf4j.query.parser.sparql.ast.ASTPathSequence.jjtAccept(ASTPathSequence.java:30)
at org.eclipse.rdf4j.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1358)
at org.eclipse.rdf4j.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:237)
at org.eclipse.rdf4j.query.parser.sparql.ast.ASTPathAlternative.jjtAccept(ASTPathAlternative.java:28

Expected Behavior

No assert errors

Steps To Reproduce

Run testsuite on files: SPARQLQueryTest, SPARQLUpdateTest, ComplexSPARQLQueryText, W3CApprovedSPARQL11QueryTest

Version

4.1.2-SNAPSHOT

Are you interested in contributing a solution yourself?

No response

Anything else?

No response

@nguyenm100 nguyenm100 added the 🐞 bug issue is a bug label Sep 9, 2022
@abrokenjester
Copy link
Contributor

abrokenjester commented Sep 16, 2022

I know @hmottestad has recently gone over quite a lot of the codebase to fix this (see GH-4189 and GH-4157). Are these problems still occurring or has this now been rectified?

@nguyenm100
Copy link
Contributor Author

Test Results - com_msd_gin_halyard_strategy_in_halyard-strategy.txt

Still occuring on 4.1.3 (see attached -- had to rename from .html to .txt to upload to comment here)

@nguyenm100
Copy link
Contributor Author

@hmottestad any updates on these asserts?

@hmottestad
Copy link
Contributor

Could you create a pull request to reproduce these issues as I'm having a hard time reproducing them myself.

@nguyenm100
Copy link
Contributor Author

just to sync, but were you able to wire up the tests mentioned here and still not seeing an issue? if so, maybe a halyard issue.

@hmottestad
Copy link
Contributor

This is what I did: #4211

Was it one of those tests?

@nguyenm100
Copy link
Contributor Author

nguyenm100 commented Oct 14, 2022

I reran the tests w/o halyard stuff and no more asserts. However, one of the test is failing and incorrect (tested against graphdb and docker rdf4j 4.2.0. graphdb returns correct result, 4.2.0 does not. It appears to also be broken in 4.1.0; i did not go back further).

Test is sparql11-exists-06

input data:

@prefix : <http://example/> .

:a :p 1 ; :q 1, 2 .
:b :p 3.0 ; :q 4.0, 5.0 .

query:

PREFIX : <http://example/>
SELECT * WHERE {
	?a :p ?n
	FILTER NOT EXISTS {
		?a :q ?m .
		FILTER(?n = ?m)
	}
}


==========================================================================================
# Expected bindings:

a=http://example/b n="3.0"^^<http://www.w3.org/2001/XMLSchema#decimal> 
==========================================================================================
# Actual bindings:

a=http://example/a n="1"^^<http://www.w3.org/2001/XMLSchema#integer> 
a=http://example/b n="3.0"^^<http://www.w3.org/2001/XMLSchema#decimal> 
==========================================================================================
# Unexpected bindings: 

a=http://example/a n="1"^^<http://www.w3.org/2001/XMLSchema#integer> 
==========================================================================================

@hmottestad
Copy link
Contributor

Query plan:

Projection (resultSizeActual=2)
╠══ProjectionElemList
║     ProjectionElem "a"
║     ProjectionElem "n"
╚══Filter (resultSizeActual=2)
   ├──Not
   │     Exists
   │        Filter (resultSizeActual=0)
   │        ╠══Compare (=)
   │        ║     Var (name=n)
   │        ║     Var (name=m)
   │        ╚══StatementPattern (resultSizeEstimate=8, resultSizeActual=4)
   │              Var (name=a)
   │              Var (name=_const_f65eef3a_uri, value=http://example/q, anonymous)
   │              Var (name=m)
   └──StatementPattern (resultSizeEstimate=4, resultSizeActual=2)
         Var (name=a)
         Var (name=_const_f65eef39_uri, value=http://example/p, anonymous)
         Var (name=n)

@hmottestad
Copy link
Contributor

hmottestad commented Oct 28, 2022

It works if I change the query to:

PREFIX : <http://example/>
SELECT * WHERE {
	?a :p ?n
	FILTER NOT EXISTS {
		?a :q ?n .
	}
}

So I think it's a scoping issue when using filters inside and EXISTS clause.

@hmottestad
Copy link
Contributor

I'm closing this issue since the original issue was about the assert in the Var class. I've create a new issue for the EXISTS scoping issue. #4256

@hmottestad hmottestad closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2022
@hmottestad hmottestad added cannot reproduce issue can not be reproduced (close reason) and removed 🐞 bug issue is a bug labels Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce issue can not be reproduced (close reason)
Projects
None yet
Development

No branches or pull requests

3 participants