Leomrlin commented on code in PR #759:
URL: https://github.com/apache/geaflow/pull/759#discussion_r2887201321


##########
geaflow/geaflow-dsl/geaflow-dsl-plan/src/main/java/org/apache/geaflow/dsl/udf/table/string/Substr.java:
##########
@@ -64,6 +67,9 @@ public BinaryString eval(BinaryString str, Integer pos, 
Integer length) {
         if (str == null || pos == null || length == null) {
             return null;
         }
+        if (pos == Integer.MIN_VALUE) {
+            return null;

Review Comment:
   Are the String and BinaryString versions inconsistent?



##########
geaflow/geaflow-dsl/geaflow-dsl-plan/src/test/java/org/apache/geaflow/dsl/udf/string/SubstrTest.java:
##########
@@ -43,4 +43,17 @@ public void test() {
         Assert.assertEquals(sb.eval(BinaryString.fromString("Facebook"), 
-5).toString(), "ebook");
         Assert.assertEquals(sb.eval(BinaryString.fromString("Facebook"), 5, 
1).toString(), "b");
     }
+
+    @Test
+    public void testIntegerMinValue() {
+        Substr sb = new Substr();
+
+        // Test Integer.MIN_VALUE for String version
+        Assert.assertEquals(sb.eval("hello", Integer.MIN_VALUE, 1), "hello");

Review Comment:
   Is this usage not common in SQL?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to