zstan commented on code in PR #13375:
URL: https://github.com/apache/ignite/pull/13375#discussion_r3729776755


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/LimitOffsetIntegrationTest.java:
##########
@@ -121,10 +128,62 @@ public void testInvalidLimitOffset() {
         assertThrows("SELECT * FROM TEST_REPL OFFSET -1 ROWS",
             IgniteSQLException.class, null);
 
+        assertThrows("SELECT * FROM TEST_REPL OFFSET -1.5 ROWS",
+            IgniteSQLException.class, null);
+
         assertThrows("SELECT * FROM TEST_REPL OFFSET 2+1 ROWS",
             IgniteSQLException.class, null);
     }
 
+    /** */
+    @Test
+    public void testFractionalLimitOffset() throws Exception {
+        fillCache(cacheRepl, 4);
+
+        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).returns(1).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).returns(1).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(3).check();
+    }
+
+    /** */
+    @Test
+    public void testFetchOffsetRoundingPolicy() throws Exception {
+        fillCache(cacheRepl, 4);
+
+        FetchOffsetRoundingPolicy floorPlc = value -> value.setScale(0, 
RoundingMode.FLOOR);

Review Comment:
   I think we do not need to test Calcite configuration setting, we need to fix 
it in our code and use over all functionality and tests, otherwize we need to 
give an ability to configure it through Ignite setting which is discussable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to