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

update separator parsing in group_concat #1693

Merged
merged 7 commits into from
Apr 4, 2023
Merged

update separator parsing in group_concat #1693

merged 7 commits into from
Apr 4, 2023

Conversation

stephkyou
Copy link
Contributor

@stephkyou stephkyou commented Apr 3, 2023

Updates separator parsing for group_concat to use new Separator struct. This change is needed to allow '' as a separator.

fixes: dolthub/dolt#5570
related: dolthub/vitess#230

@stephkyou stephkyou marked this pull request as ready for review April 3, 2023 22:44
@stephkyou stephkyou requested review from fulghum and zachmu and removed request for fulghum April 3, 2023 22:46
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than push sqlparser struct into the GroupConcat expression implementation, follow the same pattern used elsewhere: in parse.go, translate the sqlparser version of the AST into a string and give it to the GroupConcat expression. Isolate the concern of understanding sqlparser's version of the AST to the boundary layer, which is parse.go. parse.go's job is to turn that representation into one used by GMS, which should be a simple separator string (which could be the empty string), which is always printed.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stephkyou stephkyou merged commit 0ba5b35 into main Apr 4, 2023
@stephkyou stephkyou deleted the steph/dolt-5570 branch April 4, 2023 19:15
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 this pull request may close these issues.

GROUP_CONCAT() parses separator but does not respect it
2 participants