This is an automated email from the ASF dual-hosted git repository.

cancai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new b52a6b262c [CALCITE-7461] Add @Strict to ByteArrayFunction and 
ByteArrayLengthFunction
b52a6b262c is described below

commit b52a6b262cb06ae5d70e9203c720545f82ecb70e
Author: Cancai Cai <[email protected]>
AuthorDate: Fri Apr 3 17:10:51 2026 +0800

    [CALCITE-7461] Add @Strict to ByteArrayFunction and ByteArrayLengthFunction
---
 testkit/src/main/java/org/apache/calcite/util/Smalls.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/testkit/src/main/java/org/apache/calcite/util/Smalls.java 
b/testkit/src/main/java/org/apache/calcite/util/Smalls.java
index a6c52e466f..6f33f00669 100644
--- a/testkit/src/main/java/org/apache/calcite/util/Smalls.java
+++ b/testkit/src/main/java/org/apache/calcite/util/Smalls.java
@@ -31,6 +31,7 @@
 import org.apache.calcite.linq4j.function.Deterministic;
 import org.apache.calcite.linq4j.function.Parameter;
 import org.apache.calcite.linq4j.function.SemiStrict;
+import org.apache.calcite.linq4j.function.Strict;
 import org.apache.calcite.linq4j.tree.Expression;
 import org.apache.calcite.linq4j.tree.Expressions;
 import org.apache.calcite.linq4j.tree.MethodCallExpression;
@@ -1495,16 +1496,15 @@ public static ByteString eval(String s) {
   }
 
   /** User-defined function with return type byte[]. */
+  @Strict
   public static class ByteArrayFunction {
     public static byte[] eval(String s) {
-      if (s == null) {
-        return null;
-      }
       return s.getBytes(StandardCharsets.UTF_8);
     }
   }
 
   /** User-defined function with parameter type byte[]. */
+  @Strict
   public static class ByteArrayLengthFunction {
     public static int eval(byte[] bytes) {
       return bytes.length;

Reply via email to