-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Group Concat function support for separator #16237
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
246aef3
test: add failing test case
GuptaManan100 2cf1bee
feat: fix group concat with separator evaluation
GuptaManan100 b6570e5
refactor: fix the error message to prevent vtgate crash
GuptaManan100 0b0fd08
test: fix tests
GuptaManan100 1d9c21a
feat: move checking of empty separator on plan time
GuptaManan100 b0a75ea
cleanup: remove report.xml
GuptaManan100 e603162
feat: add a constant to store the group concat default separator
GuptaManan100 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
go/test/endtoend/vtgate/vitess_tester/aggregation/aggregation.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
CREATE TABLE `t1` | ||
( | ||
`id` int unsigned NOT NULL AUTO_INCREMENT, | ||
`name` varchar(191) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE InnoDB, | ||
CHARSET utf8mb4, | ||
COLLATE utf8mb4_unicode_ci; | ||
|
||
CREATE TABLE `t2` | ||
( | ||
`id` bigint unsigned NOT NULL AUTO_INCREMENT, | ||
`t1_id` int unsigned NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE InnoDB, | ||
CHARSET utf8mb4, | ||
COLLATE utf8mb4_unicode_ci; | ||
|
||
CREATE TABLE `t3` | ||
( | ||
`id` bigint unsigned NOT NULL AUTO_INCREMENT, | ||
`name` varchar(191) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE InnoDB, | ||
CHARSET utf8mb4, | ||
COLLATE utf8mb4_unicode_ci; | ||
|
||
insert into t1 (id, name) | ||
values (1, 'A'), | ||
(2, 'B'), | ||
(3, 'C'), | ||
(4, 'D'); | ||
|
||
insert into t2 (id, t1_id) | ||
values (1, 1), | ||
(2, 2), | ||
(3, 3); | ||
|
||
insert into t3 (id, name) | ||
values (1, 'A'), | ||
(2, 'B'); | ||
|
||
-- wait_authoritative t1 | ||
-- wait_authoritative t2 | ||
-- wait_authoritative t3 | ||
select group_concat(t3.name SEPARATOR ', ') as "Group Name" | ||
from t1 | ||
join t2 on t1.id = t2.t1_id | ||
left join t3 on t1.id = t3.id | ||
group by t1.id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GuptaManan100 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<testsuites tests="7"> | ||
<testsuite name="aggregation" tests="7" failures="0" errors="0" id="0" time="3.210390833" timestamp="2024-06-24 11:04:26.363877 +0530 IST m=+23.706892960"> | ||
<testcase name="CREATE TABLE `t1`
(
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE InnoDB,
CHARSET utf8mb4,
COLLATE utf8mb4_unicode_ci;" classname="" status="Line No. - 1"></testcase> | ||
<testcase name="CREATE TABLE `t2`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`t1_id` int unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE InnoDB,
CHARSET utf8mb4,
COLLATE utf8mb4_unicode_ci;" classname="" status="Line No. - 10"></testcase> | ||
<testcase name="CREATE TABLE `t3`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE InnoDB,
CHARSET utf8mb4,
COLLATE utf8mb4_unicode_ci;" classname="" status="Line No. - 19"></testcase> | ||
<testcase name="insert into t1 (id, name)
values (1, 'A'),
(2, 'B'),
(3, 'C'),
(4, 'D');" classname="" status="Line No. - 28"></testcase> | ||
<testcase name="insert into t2 (id, t1_id)
values (1, 1),
(2, 2),
(3, 3);" classname="" status="Line No. - 34"></testcase> | ||
<testcase name="insert into t3 (id, name)
values (1, 'A'),
(2, 'B');" classname="" status="Line No. - 39"></testcase> | ||
<testcase name="select group_concat(t3.name SEPARATOR ', ') as "Group Name"
from t1
join t2 on t1.id = t2.t1_id
left join t3 on t1.id = t3.id
group by t1.id;" classname="" status="Line No. - 46"></testcase> | ||
</testsuite> | ||
</testsuites> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I understand that we want to add vitess-tester tests, but there is a cost of adding new test files. For a single query testing should be not update the existing group_concat test in
TestGroupConcatAggregation
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.
I think we should use
vitess_tester
for all new tests, because of how much easier it is. Currently, the workflow is running in6m 24s
seconds, even after adding this test.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.
I'd rather like to move all the older tests to
vitess_tester