dear all:
         我用flink 注册一张表:
  CREATE TABLE dim_mysql (
    id int,  -- 
    type varchar -- 
    ) WITH (
    'connector' = 'jdbc',
    'url' = 'jdbc:mysql://localhost:3390/test',
    'table-name' = 'flink_test',
    'driver' = 'com.mysql.cj.jdbc.Driver',
    'username' = '****',
    'password' = '****',
    'lookup.cache.max-rows' = '5000',
    'lookup.cache.ttl' = '1s',
    'lookup.max-retries' = '3'
    )
有没有通过 tableEnv 去获取,字段[id,type]  类型[INTEGER,VARCHAR] 以及属性,map<String,String> 这种。
我看阿里官方有blink 支持自定义sink:
publicabstractclassCustomSinkBaseimplementsSerializable{
protectedMap<String,String> userParamsMap;// 您在sql with语句中定义的键值对,但所有的键均为小写
protectedSet<String> primaryKeys;// 您定义的主键字段名
protectedList<String> headerFields;// 标记为header的字段列表
protectedRowTypeInfo rowTypeInfo;// 字段类型和名称
核心需求是:获取定义的表的所有属性,自己实现自己的功能,包括 join sink 等各种逻辑

回复