zhangweiweikol commented on code in PR #1826: URL: https://github.com/apache/incubator-seatunnel/pull/1826#discussion_r1024917454
########## docs/en/transform/udf.md: ########## @@ -0,0 +1,47 @@ +# udf + +## Description + +Supports using UDF in data integration by the transform. +Need to specify the function name and class name and put UDF jars in Flink's classpath or import them via 'Flink run -c xxx.jar' + +:::tip + +This transform **ONLY** supported by Flink. + +::: + +## Options + +| name | type | required | default value | +| -------------- | ------ | -------- | ------------- | +| class_names | string | yes | - | +| function_names | string | yes | - | + +### class_names [string-list] + +The names of UDF classes. + +### function_names [string] Review Comment: can you give me a example about udf for java. ########## seatunnel-transforms/seatunnel-transforms-flink/seatunnel-transform-flink-udf/src/main/java/org/apache/seatunnel/flink/transform/Udf.java: ########## @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.flink.transform; + +import org.apache.seatunnel.common.config.CheckConfigUtil; +import org.apache.seatunnel.common.config.CheckResult; +import org.apache.seatunnel.flink.FlinkEnvironment; +import org.apache.seatunnel.flink.batch.FlinkBatchTransform; +import org.apache.seatunnel.flink.stream.FlinkStreamTransform; + +import org.apache.seatunnel.shade.com.typesafe.config.Config; + +import org.apache.flink.api.java.DataSet; +import org.apache.flink.streaming.api.datastream.DataStream; +import org.apache.flink.table.api.TableEnvironment; +import org.apache.flink.table.functions.UserDefinedFunction; +import org.apache.flink.types.Row; +import org.apache.flink.util.Preconditions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +public class Udf implements FlinkStreamTransform, FlinkBatchTransform { Review Comment: could you give me a example about udf for java. -- 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]
