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

str() produces NotMaterializedException when using group by/sample

    Details

      Description

      This code:

      SELECT ?id
      (SAMPLE(?img) as ?pic)
      (str(?pic) as ?description)
      WHERE {
        ?id wdt:P31 wd:Q35657 .
        ?id wdt:P6 ?head .
        OPTIONAL {
          ?head wdt:P18 ?img
        }
      } GROUP BY ?id ?head  
      

      produces a com.bigdata.rdf.internal.NotMaterializedException. If I remove the ?description projection, or even remove str(), everything is fine. ?pic has a value in every row of the result.
      Removing OPTIONAL still produces the exception.

        Activity

        Hide
        igorkim igorkim added a comment -

        michaelschmidt,
        Sorry for the delay, please look at
        https://github.com/blazegraph/database/pull/28
        This PR contains a fix, which collects real bindingset variables from referenced expressions and pass them to addMaterializationSteps2, that prevents MemoryGroupByOp to throw NotMaterializedException while evaluating aggregates based on variables defined in projection node.

        Show
        igorkim igorkim added a comment - michaelschmidt , Sorry for the delay, please look at https://github.com/blazegraph/database/pull/28 This PR contains a fix, which collects real bindingset variables from referenced expressions and pass them to addMaterializationSteps2, that prevents MemoryGroupByOp to throw NotMaterializedException while evaluating aggregates based on variables defined in projection node.
        Hide
        michaelschmidt michaelschmidt added a comment -

        Although I'm still a bit sceptical about our approach, the fix is a step in the right direction. Walked through the fix locally and all looks good. However, just to be sure I would like to run CI over the fix before merging it down. Will talk back with Brad how we can best achieve that.

        Show
        michaelschmidt michaelschmidt added a comment - Although I'm still a bit sceptical about our approach, the fix is a step in the right direction. Walked through the fix locally and all looks good. However, just to be sure I would like to run CI over the fix before merging it down. Will talk back with Brad how we can best achieve that.
        Hide
        beebs Brad Bebee added a comment -

        Cherry-picked https://github.com/blazegraph/database/pull/28 and put into CI.

        Show
        beebs Brad Bebee added a comment - Cherry-picked https://github.com/blazegraph/database/pull/28 and put into CI.
        Hide
        michaelschmidt michaelschmidt added a comment -

        CI green, labeled PR with Wikidata and merged down.

        Show
        michaelschmidt michaelschmidt added a comment - CI green, labeled PR with Wikidata and merged down.
        Hide
        michaelschmidt michaelschmidt added a comment -
        Show
        michaelschmidt michaelschmidt added a comment - For the recors: see https://github.com/blazegraph/bigdata/pull/496 for PR.

          People

          • Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            stasmalyshev stasmalyshev
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: