当前位置:网站首页>(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.
边栏推荐
- Loss function and positive and negative sample allocation: Yolo series
- LeetCode刷题——去除重复字母#316#Medium
- 04. Some thoughts on enterprise application construction after entering cloud native
- 17_ Redis_ Redis publish subscription
- 15_Redis_Redis.conf详解
- 基于RZ/G2L | OK-G2LD-C开发板存储读写速度与网络实测
- FPGA - clock-03-clock management module (CMT) of internal structure of 7 Series FPGA
- SQL transaction
- Solution of Queen n problem
- 彻底弄懂浏览器强缓存和协商缓存
猜你喜欢
PTA 天梯赛习题集 L2-001 城市间紧急救援
2022 college students in Liaoning Province mathematical modeling a, B, C questions (related papers and model program code online disk download)
搭建自己的语义分割平台deeplabV3+
FPGA - 7系列 FPGA内部结构之Clocking -03- 时钟管理模块(CMT)
搭载TI AM62x处理器,飞凌FET6254-C核心板首发上市!
18_Redis_Redis主从复制&&集群搭建
05_ queue
Leetcode skimming -- count the number of numbers with different numbers 357 medium
Case introduction and problem analysis of microservice
做好抗“疫”之路的把关人——基于RK3568的红外热成像体温检测系统
随机推荐
做好抗“疫”之路的把关人——基于RK3568的红外热成像体温检测系统
03.golang初步使用
怎样从微信返回的json字符串中截取某个key的值?
13_ Redis_ affair
LeetCode刷题——统计各位数字都不同的数字个数#357#Medium
Evaluation of embedded rz/g2l processor core board and development board of Feiling
21_Redis_浅析Redis缓存穿透和雪崩
Force deduction solution summary 2029 stone game IX
LeetCode刷题——奇偶链表#328#Medium
JVM architecture, classloader, parental delegation mechanism
语义分割学习笔记(一)
11_ Redis_ Hyperloglog_ command
Semantic segmentation learning notes (1)
How to intercept the value of a key from the JSON string returned by wechat?
How to find a sense of career direction
搭载TI AM62x处理器,飞凌FET6254-C核心板首发上市!
4. Jctree related knowledge learning
Engineer evaluation | rk3568 development board hands-on test
Map introduction
02. After containerization, you must face golang