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

DELETE WHERE fails with Java AssertionError

    Details

      Description

      I'm using revision 6361.

      Example 12 in the spec of DELETE WHERE:
      http://www.w3.org/TR/sparql11-update/#example_12

      PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
      
      DELETE WHERE {
        GRAPH <http://example.com/names> {
          ?person foaf:givenName 'Fred' ;
                  ?property1 ?value1
        }
        GRAPH <http://example.com/addresses> {
          ?person ?property2 ?value2
        }
      }
      

      fails with this stack trace:

      java.util.concurrent.ExecutionException: java.lang.AssertionError: should not be pruning any children
      	at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
      	at java.util.concurrent.FutureTask.get(Unknown Source)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.doUpdate(QueryServlet.java:421)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:115)
      	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:133)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.AssertionError: should not be pruning any children
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTJoinOrderByTypeOptimizer.optimizeJoinGroup(ASTJoinOrderByTypeOptimizer.java:620)
      	at com.bigdata.rdf.sparql.ast.optimizers.AbstractJoinGroupOptimizer.optimize(AbstractJoinGroupOptimizer.java:132)
      	at com.bigdata.rdf.sparql.ast.optimizers.AbstractJoinGroupOptimizer.optimize(AbstractJoinGroupOptimizer.java:75)
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTOptimizerList.optimize(ASTOptimizerList.java:92)
      	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convert(AST2BOpUtility.java:204)
      	at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.evaluateGraphQuery(ASTEvalHelper.java:402)
      	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUpdate.convertDeleteInsert(AST2BOpUpdate.java:912)
      	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUpdate.convertUpdateSwitch(AST2BOpUpdate.java:387)
      	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUpdate.convertUpdate(AST2BOpUpdate.java:268)
      	at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.executeUpdate(ASTEvalHelper.java:852)
      	at com.bigdata.rdf.sail.BigdataSailUpdate.execute2(BigdataSailUpdate.java:144)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$UpdateTask.doQuery(BigdataRDFContext.java:1015)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:811)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:330)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	... 1 more
      

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        The problem appears to be a failure to generate the DELETE TEMPLATE from the WHERE clause for the DELETE WHERE shortcut. If you explicitly add the same quads pattern to the DELETE TEMPLATE then the update runs:

        PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
        
        DELETE {
          GRAPH <http://example.com/names> {
            ?person foaf:givenName 'Fred' ;
                    ?property1 ?value1
          }
          GRAPH <http://example.com/addresses> {
            ?person ?property2 ?value2
          }
        }
        WHERE {
          GRAPH <http://example.com/names> {
            ?person foaf:givenName 'Fred' ;
                    ?property1 ?value1
          }
          GRAPH <http://example.com/addresses> {
            ?person ?property2 ?value2
          }
        }
        
        Show
        bryanthompson bryanthompson added a comment - The problem appears to be a failure to generate the DELETE TEMPLATE from the WHERE clause for the DELETE WHERE shortcut. If you explicitly add the same quads pattern to the DELETE TEMPLATE then the update runs: PREFIX foaf: <http://xmlns.com/foaf/0.1/> DELETE { GRAPH <http://example.com/names> { ?person foaf:givenName 'Fred' ; ?property1 ?value1 } GRAPH <http://example.com/addresses> { ?person ?property2 ?value2 } } WHERE { GRAPH <http://example.com/names> { ?person foaf:givenName 'Fred' ; ?property1 ?value1 } GRAPH <http://example.com/addresses> { ?person ?property2 ?value2 } }
        Hide
        bryanthompson bryanthompson added a comment -

        The following update request is sufficient to trigger this bug:

        DELETE WHERE {GRAPH ?g {?x foaf:name ?y} }
        

        It breaks when it sees the GRAPH group pattern.

        Show
        bryanthompson bryanthompson added a comment - The following update request is sufficient to trigger this bug: DELETE WHERE {GRAPH ?g {?x foaf:name ?y} } It breaks when it sees the GRAPH group pattern.
        Hide
        bryanthompson bryanthompson added a comment -

        The root cause is that the GRAPH clause within a QuadData pattern was not being translated into a JoinGroupNode. However, the QuadData AST node is not legal within a WHERE clause. The fix was to translate the QuadData into an appropriate JoinGroupNode when building the group for the WHERE clause in the parser.

        Committed revision r6366.

        Show
        bryanthompson bryanthompson added a comment - The root cause is that the GRAPH clause within a QuadData pattern was not being translated into a JoinGroupNode. However, the QuadData AST node is not legal within a WHERE clause. The fix was to translate the QuadData into an appropriate JoinGroupNode when building the group for the WHERE clause in the parser. Committed revision r6366.
        Hide
        bryanthompson bryanthompson added a comment -

        CI is clean.

        Show
        bryanthompson bryanthompson added a comment - CI is clean.

          People

          • Assignee:
            bryanthompson bryanthompson
            Reporter:
            dbooth-boston dbooth-boston
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: