Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separator in group_concat function with explicit empty string incorrectly defaults to 'space' character #2473

Closed
floresbakker opened this issue Jul 7, 2023 · 0 comments · Fixed by #2474

Comments

@floresbakker
Copy link

Using the group_concat function with the separator indicating an empty string ("") leads incorrectly to the default use of a space character as separator (" ").

Example code:

PREFIX : <http://example.org/>

SELECT ?subject (GROUP_CONCAT(?object; separator="") AS ?concatenatedObjects)
WHERE {
  VALUES (?subject ?object) {
    (:subject1 "a")
    (:subject1 "b")
    (:subject1 "c")
  }
}
GROUP BY ?subject

Expected outcome for concatenatedObjects:

abc

Instead we get:

a b c

@floresbakker floresbakker changed the title Separator in group_concat function with explicit empty string still defaults to 'space' character Separator in group_concat function with explicit empty string incorrectly defaults to 'space' character Jul 7, 2023
aucampia pushed a commit that referenced this issue Jul 8, 2023
`GROUP_CONCAT` was handling an empty separator (i.e. `""`) incorrectly,
it would handle it as if the separator were not set, so essentially it was
treated as a single space (i.e. `" "`).

This change fixes it so that an empty separator with `GROUP_CONCAT`
results in a value with nothing between concatenated values.


Fixes <#2473>

---------

Co-authored-by: WhiteGobo <richardfechner@posteo.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant