gustavodemorais commented on code in PR #29957: URL: https://github.com/apache/flink/pull/29957#discussion_r4698006051
########## docs/content/release-notes/flink-2.4.md: ########## @@ -0,0 +1,416 @@ +--- +title: "Release Notes - Flink 2.4" +--- + +<!-- +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. +--> + +# Release notes - Flink 2.4 + +These release notes discuss important aspects, such as configuration, behavior or dependencies, +that changed between Flink 2.3 and Flink 2.4. Please read these notes carefully if you are +planning to upgrade your Flink version to 2.4. + +### Dependencies and configuration + +#### Upgrade SLF4J to 2.0.20 + +##### [FLINK-40574](https://issues.apache.org/jira/browse/FLINK-40574) + +Flink 2.4 upgrades SLF4J from 1.7.36 to 2.0.20. Flink's default distribution uses the matching +SLF4J 2.x Log4j binding. Applications that provide another logging backend must use an SLF4J +2.x-compatible provider. In particular, Logback 1.2 is not compatible with SLF4J 2.x. + +Before upgrading, remove bundled copies of `slf4j-api 1.x` from application JARs and update custom +logging providers and bridges to versions compatible with SLF4J 2.x. Mixing SLF4J 1.x and 2.x +artifacts can prevent logging providers from being discovered and result in missing log output. + +#### Removed deprecated configuration keys + +##### [FLINK-40734](https://issues.apache.org/jira/browse/FLINK-40734) + +Related subtasks: [FLINK-40813](https://issues.apache.org/jira/browse/FLINK-40813), +[FLINK-40815](https://issues.apache.org/jira/browse/FLINK-40815), +[FLINK-40816](https://issues.apache.org/jira/browse/FLINK-40816), +[FLINK-40817](https://issues.apache.org/jira/browse/FLINK-40817). + +Flink 2.4 no longer recognizes the deprecated configuration keys listed below. Replace them with +their current keys before upgrading. If only an old key is configured, it is ignored and the +replacement option remains unset or uses its default value. + +| Removed key | Replacement key | +| --- | --- | +| `akka.client.timeout` | `client.timeout` | +| `dstl.dfs.base-path` | `state.changelog.dstl.dfs.base-path` | +| `dstl.dfs.compression.enabled` | `state.changelog.dstl.dfs.compression.enabled` | +| `dstl.dfs.preemptive-persist-threshold` | `state.changelog.dstl.dfs.preemptive-persist-threshold` | +| `dstl.dfs.batch.persist-delay` | `state.changelog.dstl.dfs.batch.persist-delay` | +| `dstl.dfs.batch.persist-size-threshold` | `state.changelog.dstl.dfs.batch.persist-size-threshold` | +| `dstl.dfs.upload.buffer-size` | `state.changelog.dstl.dfs.upload.buffer-size` | +| `dstl.dfs.upload.num-threads` | `state.changelog.dstl.dfs.upload.num-threads` | +| `dstl.dfs.discard.num-threads` | `state.changelog.dstl.dfs.discard.num-threads` | +| `dstl.dfs.upload.max-in-flight` | `state.changelog.dstl.dfs.upload.max-in-flight` | +| `dstl.dfs.upload.retry-policy` | `state.changelog.dstl.dfs.upload.retry-policy` | +| `dstl.dfs.upload.timeout` | `state.changelog.dstl.dfs.upload.timeout` | +| `dstl.dfs.upload.max-attempts` | `state.changelog.dstl.dfs.upload.max-attempts` | +| `dstl.dfs.upload.next-attempt-delay` | `state.changelog.dstl.dfs.upload.next-attempt-delay` | +| `dstl.dfs.download.local-cache.idle-timeout-ms` | `state.changelog.dstl.dfs.download.local-cache.idle-timeout-ms` | +| `kubernetes.jobmanager.cpu` | `kubernetes.jobmanager.cpu.amount` | +| `kubernetes.taskmanager.cpu` | `kubernetes.taskmanager.cpu.amount` | +| `kubernetes.container.image` | `kubernetes.container.image.ref` | +| `kubernetes.pod-template-file` | `kubernetes.pod-template-file.default` | +| `yarn.per-job-cluster.include-user-jar` | `yarn.classpath.include-user-jar` | +| `yarn.heartbeat-delay` | `yarn.heartbeat.interval` | +| `yarn.ship-directories` | `yarn.ship-files` | + +### Table SQL / API + +#### Upgrade Calcite to 1.41.0 + +##### [FLINK-39859](https://issues.apache.org/jira/browse/FLINK-39859) + +Flink 2.4 upgrades Apache Calcite, the foundation of the SQL parser and optimizer, to version +1.41.0. This incorporates the fixes and improvements from the intervening Calcite releases. +Applications that depend directly on Calcite classes or extend Flink's planner should check +their dependencies and custom planner code against the upgraded version. + +#### Common subexpression elimination in Calc code generation + +##### [FLINK-39268](https://issues.apache.org/jira/browse/FLINK-39268) + +Flink 2.4 avoids redundant evaluation of common subexpressions within a Calc operator, which +combines filtering and projection. Repeated deterministic expressions can reuse an already +computed result instead of being evaluated again for the same input row. This applies to both +batch and streaming queries and can reduce the cost of repeated built-in or user-defined +function calls. + +Reuse respects conditional evaluation, such as short-circuiting in `AND`, `OR`, and `CASE`. +UDF authors should ensure that `isDeterministic()` correctly describes their function: +functions with side effects or results that vary for identical inputs must return `false`. + +#### Built-in UDF metrics + +##### [FLINK-38071](https://issues.apache.org/jira/browse/FLINK-38071) (FLIP-485) + +SQL and Table API users can now monitor UDF execution through two built-in metrics: +`udfProcessingTime`, a histogram of sampled invocation durations, and `udfExceptionCount`, +a counter of exceptions from the function. Metrics are registered on the executing operator +under `udf.<udf_name>`. For asynchronous functions, processing time includes the time from +dispatch until completion. + +The feature is opt-in: + +- `table.exec.udf-metric-enabled` (default: `false`) enables metric collection. +- `table.exec.udf-metric.sample-interval` (default: `100`) controls how often invocation + durations are measured. Exceptions are counted on every invocation. + +The metrics cover directly invoked synchronous and asynchronous scalar and table functions. +Python functions, aggregate functions, and Process Table Functions are not covered. Enabling +the metrics adds overhead; use sampling to control the cost. + +#### Early firing for interval joins + +##### [FLINK-36953](https://issues.apache.org/jira/browse/FLINK-36953) (FLIP-497) + +Outer interval joins can emit unmatched rows before their join interval closes. The new +`EARLY_FIRE` hint emits a speculative, null-padded result after a configured delay. If a +matching row arrives later within the interval, Flink corrects the speculative result with +update-before and update-after records. + +```sql +SELECT /*+ EARLY_FIRE('delay'='5s') */ o.id, s.ship_time +FROM Orders o +LEFT OUTER JOIN Shipments s +ON o.id = s.order_id +AND o.order_time BETWEEN s.ship_time - INTERVAL '1' HOUR AND s.ship_time; +``` + +The optional `time-mode` selects `rowtime` or `proctime`; it defaults to the time mode of the +interval join. Each unmatched outer row fires at most once. The feature is disabled unless +the hint is present and requires downstream operators and sinks that accept updates. +Existing interval joins without the hint retain their behavior. + +#### FROM_CHANGELOG and TO_CHANGELOG enhancements + +##### [FLINK-39258](https://issues.apache.org/jira/browse/FLINK-39258) (FLIP-564) + +Flink 2.4 adds partitioned processing and additional controls to the changelog conversion +PTFs introduced in Flink 2.3: + +- `PARTITION BY` support to co-locate related changes, with corresponding convenience methods + on partitioned tables in the Table API. +- Partitioned `FROM_CHANGELOG` calls can use the existing PTF `ORDER BY` support to reorder + CDC events per key using a watermarked time attribute. Late events are dropped by the + sorting operation. +- `error_handling => 'FAIL' | 'SKIP'` for `FROM_CHANGELOG` to control how NULL or unmapped + operation codes are handled. The default is `FAIL`. +- `produces_full_deletes` for `TO_CHANGELOG` to choose between full-row deletes and deletes + containing only identifying keys. The default is `true`. + +These additions make it easier to consume custom CDC streams and write changelog events to +append-only sinks. Users must still provide correctly ordered, complete change events for +the selected changelog mode; the functions do not reconstruct arbitrary missing before images. +See the [Changelog Conversion documentation](https://nightlies.apache.org/flink/flink-docs-release-2.4/docs/sql/reference/queries/changelog/) +for supported mappings and input requirements. Review Comment: Suggestion to lead with what 2.3 could not do, so it is clear what changes for users upgrading. Same message as the release announcement in apache/flink-web#895. ````suggestion #### FROM_CHANGELOG and TO_CHANGELOG support all changelog modes ##### [FLINK-39258](https://issues.apache.org/jira/browse/FLINK-39258) (FLIP-564) Flink 2.3 shipped a first, minimal version of `TO_CHANGELOG` and `FROM_CHANGELOG` that only supported retract mode: `FROM_CHANGELOG` required separate `UPDATE_BEFORE` and `UPDATE_AFTER` events, and `TO_CHANGELOG` on an upsert input always added a stateful `ChangelogNormalize` operator to the job. Flink 2.4 supports all changelog modes: - `TO_CHANGELOG` skips `ChangelogNormalize` for upsert inputs when the `op_mapping` omits `UPDATE_BEFORE` and either omits `DELETE` or sets `produces_full_deletes => false`. With `produces_full_deletes => false`, DELETE rows keep only the key columns. An `op_mapping` with only `INSERT` and `UPDATE_AFTER` turns an upsert input into an append-only stream that operators accepting only append-only input, such as window deduplication, can consume. - `FROM_CHANGELOG` produces an upsert table when the input uses `PARTITION BY <key>` and the `op_mapping` contains `UPDATE_AFTER` but not `UPDATE_BEFORE`. The partition key becomes the upsert key. - Both functions accept `PARTITION BY`, also through `fromChangelog()` and `toChangelog()` on `PartitionedTable`. Partitioned `FROM_CHANGELOG` calls can use `ORDER BY` on a watermarked time attribute to reorder events per key; late events are dropped. - `error_handling => 'FAIL' | 'SKIP'` controls how `FROM_CHANGELOG` handles NULL or unmapped operation codes. The default is `FAIL`. `FROM_CHANGELOG` trusts the operation codes it receives: a wrong `op_mapping` or out-of-order events silently produce a wrong table. See the [Changelog Conversion documentation](https://nightlies.apache.org/flink/flink-docs-release-2.4/docs/sql/reference/queries/changelog/) for supported mappings and input requirements. ```` -- 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]
