Uploaded image for project: 'Marmotta (Retired)'
  1. Marmotta (Retired)
  2. MARMOTTA-578

Evaluation of GROUP BY and ORDER BY together fails on PostgreSQL

    XMLWordPrintableJSON

Details

    Description

      Any SPARQL query with both constructions:

      SELECT ?person ?name
      WHERE {
        ?person a foaf:Person ;
          foaf:name ?name .
      }
      GROUP BY ?person ?name
      ORDER BY ?name
      LIMIT 10
      

      looks to fail:

      org.openrdf.query.QueryEvaluationException: org.postgresql.util.PSQLException: ERROR: column "p2_object_v2.svalue" must appear in the GROUP BY clause or be used in an aggregate function
        Position: 431
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
      	at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy$1.call(KiWiEvaluationStrategy.java:220)
      	at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy$1.call(KiWiEvaluationStrategy.java:216)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Activity

          People

            wikier Sergio Fernández
            wikier Sergio Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Time Spent - 2h Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - 2h Remaining Estimate - 2h
                2h