-
Notifications
You must be signed in to change notification settings - Fork 1.9k
IGNITE-28896 SQL Calcite: Adjust fractional value handling in FETCH, OFFSET, and LIMIT #13375
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ac25617
IGNITE-28896 Wip
tkalkirill 164f5f6
IGNITE-28896 Wip
tkalkirill 603d101
IGNITE-28896 Wip
tkalkirill 3d4e2f3
Merge branch 'master' into ignite-28896
tkalkirill 8d3c137
Merge branch 'master' into ignite-28896
tkalkirill 4742153
Merge branch 'master' into ignite-28896
tkalkirill 710c7c1
IGNITE-28896 Wip
tkalkirill c08ffe1
IGNITE-28896 Wip
tkalkirill 49dd7d4
IGNITE-28896 Wip
tkalkirill f799fb8
IGNITE-28896 Wip
tkalkirill 442af9a
IGNITE-28896 Wip
tkalkirill f0976b5
IGNITE-28896 Wip
tkalkirill e34b91d
IGNITE-28896 Wip
tkalkirill 79769ba
IGNITE-28896 Wip
tkalkirill 7728373
IGNITE-28896 Wip
tkalkirill 857026d
IGNITE-28896 Wip
tkalkirill 12fc599
IGNITE-28896 Wip
tkalkirill 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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,12 +93,12 @@ public class LimitOffsetIntegrationTest extends AbstractBasicIntegrationTransact | |
|
|
||
| /** */ | ||
| @Test | ||
| public void testNestedLimitOffsetWithUnion() { | ||
| sql("INSERT into TEST_REPL VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')"); | ||
| public void testNestedLimitOffsetWithUnion() throws Exception { | ||
| fillCache(cacheRepl, 4); | ||
|
|
||
| assertQuery("(SELECT id FROM TEST_REPL WHERE id = 2) UNION ALL " + | ||
| assertQuery("(SELECT id FROM TEST_REPL WHERE id = 1) UNION ALL " + | ||
| "SELECT id FROM (select id from (SELECT id FROM TEST_REPL OFFSET 2) order by id OFFSET 1)" | ||
| ).returns(2).returns(4).check(); | ||
| ).returns(1).returns(3).check(); | ||
| } | ||
|
|
||
| /** Tests correctness of fetch / offset params. */ | ||
|
|
@@ -121,10 +121,33 @@ public void testInvalidLimitOffset() { | |
| assertThrows("SELECT * FROM TEST_REPL OFFSET -1 ROWS", | ||
| IgniteSQLException.class, null); | ||
|
|
||
| assertThrowsSqlException("SELECT * FROM TEST_REPL OFFSET -1.5 ROWS", null); | ||
|
|
||
| assertThrowsSqlException("SELECT * FROM TEST_REPL OFFSET -0.5 ROWS", null); | ||
|
|
||
| assertThrows("SELECT * FROM TEST_REPL OFFSET 2+1 ROWS", | ||
| IgniteSQLException.class, null); | ||
| } | ||
|
|
||
| /** */ | ||
| @Test | ||
| public void testFractionalLimitOffset() throws Exception { | ||
|
zstan marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we already have the same tests in script ones: limit.test do you think we also need it here ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would keep it. |
||
| fillCache(cacheRepl, 4); | ||
|
|
||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id LIMIT 0.5").check(); | ||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id LIMIT 1.2").returns(0).check(); | ||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id LIMIT 1.5").returns(0).check(); | ||
|
|
||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id FETCH FIRST 0.5 ROWS ONLY").check(); | ||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id FETCH FIRST 1.3 ROWS ONLY").returns(0).check(); | ||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id FETCH FIRST 1.6 ROWS ONLY").returns(0).check(); | ||
|
|
||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id OFFSET 0.5 ROWS") | ||
| .returns(0).returns(1).returns(2).returns(3).check(); | ||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id OFFSET 2.3 ROWS").returns(2).returns(3).check(); | ||
| assertQuery("SELECT id FROM TEST_REPL ORDER BY id OFFSET 2.6 ROWS").returns(2).returns(3).check(); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| */ | ||
|
|
||
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.