package flinkdemo.flinksql.sqlJoin;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.table.api.Table;
import org.apache.flink.table.api.java.BatchTableEnvironment;
import org.apache.flink.table.functions.ScalarFunction;
import org.apache.flink.types.Row;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangkai
* @create 2019/12/23
*/
public class UdfSql {
/**
* 继承 ScalarFunction 类
* 重写 eval方法
* tableEnv注册 udf 函数
* sql使用函数
* */
public static void main(String[] args) throws Exception{
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
BatchTableEnvironment tableEnv = BatchTableEnvironment.create(env);
tableEnv.registerFunction("stringCo