add new sql test "partition by combined with rank" #772
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.
While working on project 3, I discovered that my implementation of window_function was incorrect, but it still passed all the tests including p3.20-window-function. After investigating, I found that this was due to the absence of a test case combining the PARTITION BY clause with a RANK query.
Specifically, when PARTITION BY and RANK are used together, ranking should be done within each partitioned group. However, my incorrect implementation performed ranking without considering the partitions. Despite this, it still passed all the current tests in p3.20-window-function. To address this, I have added a new test case that ensures the proper behavior when PARTITION BY and RANK are used together.
Although the combination of PARTITION BY and RANK appears in the p3.leaderboard-q1-window.slt tests, these leaderboard tests are optional. Therefore, if someone does not attempt the leaderboard tests, they might not notice similar issues in their implementation, as I did.