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

order by and group_concat

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed - Won't Fix
    • Resolution: Incomplete
    • Affects Version/s: BIGDATA_RELEASE_1_2_3
    • Fix Version/s: None
    • Component/s: Bigdata SAIL
    • Labels:
      None

      Description

      Normally aggregate functions are order independent, thus an order by on a select with an aggregate function can be ignored.
      However, group_concat is order dependent.

      With my test data the following query

      base <http://localhost:8000/>
      prefix c2: </bdm/api/kbobject/c2:>
      SELECT ( GROUP_CONCAT( ?x ) as ?y )
      WHERE {
              ?BaseTestAppClass_A c2:testRootEnum $x
      } ORDER BY ?x
      

      returns "Female Male and Female N/A Both"

      whereas the non-aggregate

      base <http://localhost:8000/>
      prefix c2: </bdm/api/kbobject/c2:>
      SELECT ?x
      WHERE {
              ?BaseTestAppClass_A c2:testRootEnum $x
      } ORDER BY ?x
      

      returns

      Both
      Female
      Male and Female
      N/A
      

      The workaround is to push the ordering into a subselect.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: