
|
If you were logged in you would be able to see more operations.
|
|
|
Issue Links:
|
Followup
|
|
|
|
This issue is followed up by:
|
|
SES-998
ClassCastException on queries with sa...
|
|
|
|
|
|
Example query:
select * where { ?s ?p ?o, ?x filter (sameTerm("literal", ?s)) }
causes a ClassCastException when evaluated on a native store. See stacktrace below.
Apparent cause of the bug is that the SameTermFilterOptimizer inlines the variable ?s with the literal value "literal". The native store's cardinality calculator tries to determine the cardinality of the statement pattern (?s, ?p, ?o) and attempts to cast the value of ?s to a resource (which it isn't, because we have just inlined it to a literal).
Two possible fixes. Either adapt SameTermFilterOptimizer to not inline literals in statementpattern-positions they can't legally occur, or alternatively adapt NativeStoreCardinalityCalculator to catch ClassCastExceptions and revert to a default cardinality estimate.
Stacktrace (as provided by Allesandro Bollini on the mailinglist):
java.lang.ClassCastException: org.openrdf.model.impl.LiteralImpl cannot be cast to org.openrdf.model.Resource
at org.openrdf.sail.nativerdf.NativeEvaluationStatistics$NativeCardinalityCalculator.getCardinality(NativeEvaluationStatistics.java:43)
at org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics$CardinalityCalculator.meet(EvaluationStatistics.java:114)
at org.openrdf.query.algebra.StatementPattern.visit(StatementPattern.java:212)
at org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics.getCardinality(EvaluationStatistics.java:43)
at org.openrdf.query.algebra.evaluation.impl.QueryJoinOptimizer$JoinVisitor.meet(QueryJoinOptimizer.java:89)
at org.openrdf.query.algebra.Join.visit(Join.java:51)
(snip)
|
|
|
There are no comments yet on this issue.
|
| |
|
|