lincoln-lil commented on code in PR #20679: URL: https://github.com/apache/flink/pull/20679#discussion_r972847928
########## docs/content.zh/docs/dev/table/concepts/determinism.md: ########## @@ -0,0 +1,251 @@ +--- +title: "流上的确定性 (Determinism in Continuous Queries)" +weight: 2 +type: docs +aliases: + - /zh/dev/table/streaming/determinism.html +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +# 流上的确定性(Determinism In Continuous Queries) +本文主要介绍了以下内容: + +1. 什么是确定性? +2. 批处理都是确定性的吗? + - 两个非确定性结果的批查询示例 + - 批处理中的不确定性因素 +3. 流上的确定性 + - 流上的不确定性 + - 流上的不确定更新 + - 如何消除流查询的不确定性影响 + +## 1. 什么是确定性? +引用 SQL 标准中对确定性的描述:"如果一个操作在重复相同的输入值时能保证计算出相同的结果,那么该操作就是确定性的"。 + +## 2. 批处理都是确定性的吗? +在经典的批处理场景,对于给定的有界数据集,重复执行同一查询会得到一致的结果,这是对确定性最直观的理解。但实际上,同一个查询在批处理上也并不总是能得到一致的结果,来看两个查询示例: + +### 2.1 两个非确定性结果的批查询示例 +比如有一张新建的网站点击日志表: +```sql +CREATE TABLE clicks ( + uid VARCHAR(128), + cTime TIMESTAMP(3), + url VARCHAR(256) +) +``` + +新写入了一些数据: +```gitexclude Review Comment: should be removed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
