Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Retraction fallback updates in FlinkSQL are carried out

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How the Retraction fallback update in FlinkSQL is carried out, I believe many inexperienced people are at a loss about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Preface

If you get the following error when using FlinkSQL:

Table is not an append-only table. Use the toRetractStream () in order to handle add and retract messages. Then you need to know about fallback updates in Flink. Brief introduction

Generally speaking, "fallback update" is the update operation in traditional data, that is to say, Retract is the processing of data update in streaming computing scenarios.

Using flinkSQL to process real-time data when we convert a table into a stream, we need to use both toAppendStream and toRetractStream methods. If you don't pay attention, you may have chosen toAppendStream directly.

Difference

Append mode: this mode can only be used if dynamic Table is modified only through INSERT, that is, it is only attached, and previously issued results are never updated.

If the update or delete operation uses append mode, it will fail to report an error.

Indent mode: you can always use this mode. The return value is of type boolean. It marks the insertion and withdrawal of data with true or false, and returns true for data insertion and false for data withdrawal.

According to the understanding of the official website, if the data is constantly added, you can use the append mode, while the rest cannot use the append mode, while the indentation mode can be applied to update, delete and other scenarios. The differences are shown in the following figure:

From the figure above, you can clearly see the difference between the two ways. When the sql statement we use contains: count () group by, we must use indentation mode.

For instance

The output of the above example is as follows:

The previous numbers are the same as the same set of operations, true represents write, and false represents recall.

After reading the above, have you mastered how the Retraction fallback update in FlinkSQL works? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report