AMashenkov commented on code in PR #2159:
URL: https://github.com/apache/ignite-3/pull/2159#discussion_r1221658256


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItFunctionsTest.java:
##########
@@ -285,16 +285,37 @@ public void testTypeOf() {
         assertThrowsWithCause(() -> sql("SELECT TYPEOF(SELECT 1, 2)"), 
CalciteContextException.class);
     }
 
+    /**
+     * Tests for {@code SUBSTRING(str, start[, length])} function.
+     */
+    @Test
+    public void testSubstring() {
+        assertQuery("SELECT SUBSTRING('1234567', 1, 
3)").returns("123").check();
+        assertQuery("SELECT SUBSTRING('1234567', 
2)").returns("234567").check();
+        assertQuery("SELECT SUBSTRING('1234567', 
-1)").returns("1234567").check();
+        assertQuery("SELECT SUBSTRING(1000, 1, 3)").returns("100").check();
+
+        assertQuery("SELECT SUBSTRING(NULL FROM 1 FOR 
2)").returns(null).check();
+        assertQuery("SELECT SUBSTRING('text' FROM 1 FOR 
null)").returns(null).check();
+        assertQuery("SELECT SUBSTRING('test' FROM null FOR 
2)").returns(null).check();
+
+        // uncomment after https://issues.apache.org/jira/browse/CALCITE-5708 
was merged.

Review Comment:
   We don't track Calcite tickets. 
   Maybe there is an Ignite ticket to fix this issue or to bump Calcite 
dependency version?



-- 
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