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
?
?
?
?
總結
以上是生活随笔為你收集整理的flink-faker用法示例(还没弄完,到时候再说)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 七月你好的唯美句子157个
- 下一篇: alink的相關資料收集