-
Notifications
You must be signed in to change notification settings - Fork 690
Add GROUP_CONCAT support for ORDER BY and SEPARATOR clauses #2418
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
Conversation
|
@copilot Continue |
|
@copilot continue |
|
Continue |
|
@copilot Continue... |
Implementation complete! I've successfully added full support for MySQL-style GROUP_CONCAT with ORDER BY and SEPARATOR clauses. Changes made (commit 19b2b5c):
Supported syntax: SELECT GROUP_CONCAT(DISTINCT country ORDER BY country ASC SEPARATOR ';')
FROM diary;
Work completed! The GROUP_CONCAT feature is now fully implemented with ORDER BY and SEPARATOR support. All tests are passing and the code has been reviewed for quality and security. The implementation is ready for your review. ✨ |
mathiasrw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a lot of code for such a simple issue.
Can you please review and see how we can get a more elegant solution?
1688c85 to
165f40e
Compare
|
.................................................... 563 passing (781ms)
|
Fixed (commit e33dc5b). The issue was that SEPARATOR as a reserved token was being recognized in JSON property names like |
ca6bd69 to
f7e1d47
Compare
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
…g comments Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
…r function Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
…mmar Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
dc3f883 to
80d8075
Compare
Summary of Implementation
This PR implements full MySQL-style GROUP_CONCAT syntax support with ORDER BY and SEPARATOR clauses, resolving the parse error that prevented users from using these features.
Parser Implementation
GROUP_CONCAT as First-Class Token:
GROUP_CONCAT LPAR ... RPARsyntax instead of runtime IF checksGroupConcatOrderClauseandGroupConcatSeparatorClausefor clean grammar structureProper SEPARATOR Token Handling (Jison Best Practice):
SEPARATOR STRINGin GroupConcatSeparatorClause for clean grammar without runtime checksAggregator Implementation
Enhanced GROUP_CONCAT Function (
src/55functions.js):Compilation Optimization (
src/423groupby.js):getGroupConcatParams()helper function to eliminate code duplicationSupported Syntax
Testing
assert.deepEqualfor complete object validation (except test B which tests unordered results)The implementation follows proper Jison/yacc parser design patterns where keywords can be context-aware by:
This allows SEPARATOR to be a keyword in GROUP_CONCAT while still being usable as a property name in JSON objects.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.