微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

flink-faker用法示例(还没弄完,到时候再说)

本文针对的是flink-faker这个连接器

https://github.com/knaufk/flink-faker

下面的使用案例来自ververica的flink-sql-cookbook

 

 

 

 

 

 

数据类型(不要忘记最后添加逗号)生成该数据的设置方式(不要忘记最后添加逗号)生成的数据举例
连接器'connector' = 'faker',-
client_ip STRING'fields.client_ip.expression' = '#{Internet.publicIpV4Address}' 
'fields.client_ip.expression' '#{Internet.publicIpV4Address}' 
product_id BIGINT  
price DECIMAL(32, 2)  
doctor STRING'fields.doctor.expression' = '#{dr_who.the_doctors}'Seventh Doctor
sighting_time TIMESTAMP(3)'fields.sighting_time.expression' = '#{date.past ''15'',''SECONDS''}'

2021-01-05T11:54:41

 

 

>     client_ip STRING,
>     client_identity STRING, 
>     userid STRING, 
>     user_agent STRING,
>     log_time TIMESTAMP(3),
>     request_line STRING, 
>     status_code STRING, 
>     size INT
> ) WITH (
>   'connector' = 'faker', 
>   'fields.client_ip.expression' = '#{Internet.publicIpV4Address}',
>   'fields.client_identity.expression' =  '-',
>   'fields.userid.expression' =  '-',
>   'fields.user_agent.expression' = '#{Internet.userAgentAny}',
>   'fields.log_time.expression' =  '#{date.past ''15'',''5'',''SECONDS''}',
>   'fields.request_line.expression' = '#{regexify ''(GET|POST|PUT|PATCH){1}''} #{regexify ''(/search\.html|/login\.html|/prod\.html|cart\.html|/order\.html){1}''} #{regexify ''(HTTP/1\.1|HTTP/2|/HTTP/1\.0){1}''}',
>   'fields.status_code.expression' = '#{regexify ''(200|201|204|400|401|403|301){1}''}',
>   'fields.size.expression' = '#{number.numberBetween ''100'',''10000000''}'
> );

 

 

Reference:

[1]DataGen SQL Connector

 

 

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐