当前位置:网站首页>(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.
边栏推荐
猜你喜欢

Leetcode skimming -- incremental ternary subsequence 334 medium

How to choose a third-party software testing organization for automated acceptance testing of mobile applications

02_ Linear table_ Sequence table

19_ Redis_ Manually configure the host after downtime

搭建自己的语义分割平台deeplabV3+

21_ Redis_ Analysis of redis cache penetration and avalanche

15_ Redis_ Redis. Conf detailed explanation

PTA 天梯赛习题集 L2-001 城市间紧急救援

Solution of Queen n problem

Kibana basic operation
随机推荐
MySQL -- Index Optimization -- order by
Tidb cross data center deployment topology
搭载TI AM62x处理器,飞凌FET6254-C核心板首发上市!
【LeetCode】1254-统计封闭岛屿的数量
飞凌嵌入式RZ/G2L处理器核心板及开发板上手评测
PTA 天梯赛习题集 L2-001 城市间紧急救援
02. After containerization, you must face golang
【LeetCode】417-太平洋大西洋水流问题
How does the computer set up speakers to play microphone sound
Equipped with Ti am62x processor, Feiling fet6254-c core board is launched!
Tidb environment and system configuration check
2022 年辽宁省大学生数学建模A、B、C题(相关论文及模型程序代码网盘下载)
LeetCode_ Sliding window_ Medium_ 395. Longest substring with at least k repeated characters
面对“缺芯”挑战,飞凌如何为客户产能提供稳定强大的保障?
4. Jctree related knowledge learning
06_ Stack and queue conversion
07_ Hash
02_线性表_顺序表
【Leetcode】167-两数之和II -输入有序数组
04.进入云原生后的企业级应用构建的一些思考