Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1648

Proper FILTER handling in merge join

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: BLAZEGRAPH_2_0_0
    • Component/s: None
    • Labels:
      None

      Description

      Consider data

      <http://s1a> <http://p> <http://o1> .
      <http://s1b> <http://p> <http://o1> .
      <http://s2> <http://p> <http://o2> .
      

      The following query works fine:

      Select *
      WITH {
        
        SELECT * WHERE { ?s1 <http://p> ?o }
        
      } AS %sub1
      WITH {
        
        SELECT * WHERE { ?s2 <http://p> ?o }
          
      } AS %sub2
      WITH {
        SELECT * WHERE {
          INCLUDE %sub1
          INCLUDE %sub2
        }
      } AS %sub3
      WHERE {
        INCLUDE %sub3
        FILTER (?s1 != ?s2) .
      }
      

      , whereas the simplified version

      SELECT *
      WITH {
        
        SELECT * WHERE { ?s1 <http://p> ?o }
        
      } AS %sub1
      WITH {
        
        SELECT * WHERE { ?s2 <http://p> ?o }
          
      } AS %sub2
      WHERE {
        INCLUDE %sub1
        INCLUDE %sub2
        FILTER (?s1 != ?s2) .
      }
      

      throws an exception:

      ERROR: SPARQL-QUERY: queryStr=SELECT * WITH { SELECT * WHERE { ?s1 ?o } } AS %sub1 WITH { SELECT * WHERE { ?s2 ?o } } AS %sub2 WHERE { INCLUDE %sub1 INCLUDE %sub2 FILTER (?s1 != ?s2) . } java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.ArrayStoreException: com.bigdata.rdf.sparql.ast.FilterNode at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:281) at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:636) at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:263) at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:248) at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doPost(MultiTenancyServlet.java:140) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:497) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) at java.lang.Thread.run(Thread.java:745) Caused by: java.util.concurrent.ExecutionException: java.lang.ArrayStoreException: com.bigdata.rdf.sparql.ast.FilterNode at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlQueryTask.call(QueryServlet.java:834) at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlQueryTask.call(QueryServlet.java:653) at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ... 1 more Caused by: java.lang.ArrayStoreException: com.bigdata.rdf.sparql.ast.FilterNode at java.util.LinkedList.toArray(LinkedList.java:1103) at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.doMergeJoin(AST2BOpUtility.java:3575) at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convertJoinGroup(AST2BOpUtility.java:3050) at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convertJoinGroupOrUnion(AST2BOpUtility.java:2453) at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convertQueryBaseWithScopedVars(AST2BOpUtility.java:450) at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convert(AST2BOpUtility.java:285) at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.evaluateTupleQuery(ASTEvalHelper.java:235) at com.bigdata.rdf.sail.BigdataSailTupleQuery.evaluate(BigdataSailTupleQuery.java:93) at com.bigdata.rdf.sail.BigdataSailTupleQuery.evaluate(BigdataSailTupleQuery.java:75) at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:75) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:1711) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.innerCall(BigdataRDFContext.java:1568) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1533) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:705)
      

        Attachments

          Activity

            People

            Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            michaelschmidt michaelschmidt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: