Repository navigation
Fix result columns of grouped queries to close #2770 and #2766 - #3000
Open
mateuscmtropical wants to merge 2 commits into
Open
mateuscmtropical wants to merge 2 commits into
mateuscmtropical wants to merge 2 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #2770
Closes #2766
What was wrong
compileSelectGroup0gives a repeated column a unique nick likec0:1.compileSelectGroup1writes the output key from the column name, butcompileSelectGroup2wrote group key columns undercol.as || col.nick, so the nick leaked into the row. A grouped query also had noquery.columns, so MATRIX and RECORDSET took their columns from the row keys.What changed
compileSelectGroup2uses the same output key ascompileSelectGroup1.compileSelectGroup1fillsquery.columnsin select list order when there is no*. MATRIX and RECORDSET now show a repeated column twice, the same as without GROUP BY. They also keep the select order when a column name is an integer, like17(MATRIX puts a column named by a number first when the query has an aggregate: SELECT COUNT(*), 17 gives [17, 1] #2766). Before, they followed the key order of the row object, which lists integer keys first.Tests
test/test2770.jscovers the rows from the issue table, MATRIX, RECORDSET columns, distinct aliases and the MATRIX order from #2766. All but the distinct aliases case fail ondevelop.yarn test-onlygives 2552 pass on this branch. The only failures are the 5Test 418cases that load files from the internet.