@@ -645,13 +645,14 @@ public static class NamedParameterClass extends ScalarFunction {
645645{{< tab "Scala" >}}
646646``` scala
647647import org .apache .flink .table .annotation .ArgumentHint ;
648+ import org .apache .flink .table .annotation .DataTypeHint ;
648649import org .apache .flink .table .functions .ScalarFunction ;
649650
650651class NamedParameterClass extends ScalarFunction {
651652
652653 // Use the @ArgumentHint annotation to specify the name, type, and whether a parameter is required.
653- def eval (@ ArgumentHint (name = " param1" , isOptional = false , `type` = @ DataTypeHint (" STRING" )) s1 : String ,
654- @ ArgumentHint (name = " param2" , isOptional = true , `type` = @ DataTypeHint (" INTEGER" )) s2 : Integer ) = {
654+ def eval (@ ArgumentHint (name = " param1" , isOptional = false , `type` = new DataTypeHint (" STRING" )) s1 : String ,
655+ @ ArgumentHint (name = " param2" , isOptional = true , `type` = new DataTypeHint (" INTEGER" )) s2 : Integer ) = {
655656 s1 + " , " + s2
656657 }
657658}
@@ -673,7 +674,7 @@ public static class NamedParameterClass extends ScalarFunction {
673674 @FunctionHint (
674675 arguments = {
675676 @ArgumentHint (name = " param1" , isOptional = false , type = @DataTypeHint (" STRING" )),
676- @ArgumentHint (name = " param2" , isOptional = true , type = @DataTypeHint (" INTEGER" ))
677+ @ArgumentHint (name = " param2" , isOptional = true , type = @DataTypeHint (" INTEGER" ))
677678 }
678679 )
679680 public String eval (String s1 , Integer s2 ) {
@@ -685,6 +686,8 @@ public static class NamedParameterClass extends ScalarFunction {
685686{{< tab "Scala" >}}
686687``` scala
687688import org .apache .flink .table .annotation .ArgumentHint ;
689+ import org .apache .flink .table .annotation .DataTypeHint ;
690+ import org .apache .flink .table .annotation .FunctionHint ;
688691import org .apache .flink .table .functions .ScalarFunction ;
689692
690693class NamedParameterClass extends ScalarFunction {
@@ -710,6 +713,8 @@ class NamedParameterClass extends ScalarFunction {
710713{{< tab "Java" >}}
711714``` java
712715import org.apache.flink.table.annotation.ArgumentHint ;
716+ import org.apache.flink.table.annotation.DataTypeHint ;
717+ import org.apache.flink.table.annotation.FunctionHint ;
713718import org.apache.flink.table.functions.ScalarFunction ;
714719
715720// Use the @ArgumentHint annotation to specify the name, type, and whether a parameter is required.
@@ -730,6 +735,8 @@ public static class NamedParameterClass extends ScalarFunction {
730735{{< tab "Scala" >}}
731736``` scala
732737import org .apache .flink .table .annotation .ArgumentHint ;
738+ import org .apache .flink .table .annotation .DataTypeHint ;
739+ import org .apache .flink .table .annotation .FunctionHint ;
733740import org .apache .flink .table .functions .ScalarFunction ;
734741
735742// Use the @ArgumentHint annotation to specify the name, type, and whether a parameter is required.
0 commit comments