当前位置:网站首页>(4) Flink's table API and SQL table schema
(4) Flink's table API and SQL table schema
2022-07-02 15:35:00 【wx5ba7ab4695f27】
List of articles
table schema Defined Flink Table The data table structure of , Include field names , type , meanwhile Table Schema Hui He Table Format Match , stay Table Data input or output process Schema Transformation
But when Table Input/Output Format and Table Schema When they disagree , All need corresponding Mapping Relationship to map
Be careful : Users must follow Input/Output The order of fields in the data source TableSchema
withSchema(
new Schema()
.field("id",Types.INT)
.field("id",Types.STRING)
)
- 1.
- 2.
- 3.
- 4.
- 5.
In addition to creating Table Schema When specifying the name and type , Supported by proctime and rowtime And other methods to obtain the time attribute in the external data , among proctime Method does not need to pass parameters ,rowtime You need to define the time field and watermark Generative logic , At the same time, you can also use from Method maps from the dataset by name Table Schema Field information
.withSchema(
new Schema()
.field("Field",Types.INT)
.proctime()
.field("f2",Types.STRING)
.rowtime(...)
.field("f3",Types.STRING)
.from("origin_field_name")
)
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
If Table API be based on Event Time Time concept processing data , You need to generate time in the access data Rowtime Information , as well as Watermark The generative logic of
.rowtime(
// You can extract from the input data according to the field name
new Rowtime().timestampsFromField("ts_filed")
// Or from the bottom DataStream API From , The data source needs to support the allocation of timestamps ( Such as Kafka 0.10X)
new Rowtime().timestampsFromSource()
// Or through customization timestampsFromSource extract Rowtime
new Rowtime().timestampsFromExtractor()
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
Immediately after Rowtime() After the object instance, you need to specify Watermark Strategy
.rowtime(
// Time delay 2s Generate watermark
new Rowtime().watermarksPeriodicBounded(2000)
// and rowtime The maximum time is consistent
new Rowtime().watermarksPeriodicAscending()
// Use the bottom layer DataStream API The built-in Watermark
new Rowtime().watermarksFromSource()
)
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
边栏推荐
- 15_ Redis_ Redis. Conf detailed explanation
- 03_線性錶_鏈錶
- 20_Redis_哨兵模式
- 损失函数与正负样本分配:YOLO系列
- Guangzhou Emergency Management Bureau issued a high temperature and high humidity chemical safety reminder in July
- 党史纪实主题公益数字文创产品正式上线
- folium地图无法显示的问题,临时性解决方案如下
- 2022 年辽宁省大学生数学建模A、B、C题(相关论文及模型程序代码网盘下载)
- 彻底弄懂浏览器强缓存和协商缓存
- QML pop-up frame, customizable
猜你喜欢

10_Redis_geospatial_命令

17_ Redis_ Redis publish subscription

Set set you don't know

Redux - detailed explanation

Bing.com网站

03. Preliminary use of golang

XML Configuration File

【LeetCode】1162-地图分析

How to avoid 7 common problems in mobile and network availability testing

Leetcode skimming -- verifying the preorder serialization of binary tree # 331 # medium
随机推荐
03_线性表_链表
16_Redis_Redis持久化
11_ Redis_ Hyperloglog_ command
19_ Redis_ Manually configure the host after downtime
How to test tidb with sysbench
How to write sensor data into computer database
03.golang初步使用
Force deduction solution summarizes the lucky numbers in 1380 matrix
【LeetCode】577-反转字符串中的单词 III
13_ Redis_ affair
12_ Redis_ Bitmap_ command
Huffman tree: (1) input each character and its weight (2) construct Huffman tree (3) carry out Huffman coding (4) find hc[i], and get the Huffman coding of each character
MD5 encryption
05_ queue
Redux——详解
Practice of compiling principle course -- implementing an interpreter or compiler of elementary function operation language
【LeetCode】1162-地图分析
Leetcode skimming -- count the number of numbers with different numbers 357 medium
How to choose a third-party software testing organization for automated acceptance testing of mobile applications
03. Preliminary use of golang