Timm0 commented on code in PR #30031:
URL: https://github.com/apache/flink/pull/30031#discussion_r4681149689
##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/MaterializedPipeline.java:
##########
@@ -36,46 +37,58 @@ public interface MaterializedPipeline {
ObjectIdentifier getIdentifier();
/**
- * Submits this declaration with the semantics of {@code CREATE OR ALTER
MATERIALIZED TABLE}.
- *
- * <p>If the materialized table exists and its continuous refresh job is
running, the job is
- * stopped with a savepoint and a new refresh job is started, which does
not restore that
- * savepoint. This also happens if the declaration is unchanged. The stop
requires a savepoint
- * directory ({@code execution.checkpointing.savepoint-dir}); without one,
this fails before the
- * stop. If the changes are rejected or cannot be written after the stop,
the materialized table
- * is left suspended with its previous definition and the savepoint. If
the new refresh job
- * starts but the catalog cannot record it, that job is cancelled and the
previous refresh job
- * restarts from the savepoint. If the cancel fails, the materialized
table is rolled back and
- * left suspended instead.
- *
- * <p>A suspended materialized table is altered and stays suspended, and
its stored savepoint is
- * cleared, so a later {@code RESUME} starts the refresh job without
state. A materialized table
- * in full refresh mode is altered without changing its refresh workflow.
- *
- * <p>An existing materialized table keeps its freshness, comment and
partition keys, so a
- * declared one is ignored. Its options and distribution are replaced by
the declared ones, as
- * by the {@code WITH} and {@code DISTRIBUTED BY} clauses of {@code CREATE
OR ALTER MATERIALIZED
- * TABLE}. Options that are not declared are removed, and the distribution
is dropped if none is
- * declared. A declared {@link RefreshStrategy#continuous()} or {@link
RefreshStrategy#full()}
- * that differs from its refresh mode is rejected like any other rejected
change, which leaves a
- * running table suspended. If the declared schema starts with a physical
column, it replaces
- * the watermark, computed columns, virtual metadata columns and primary
key of the materialized
- * table. Otherwise, the materialized table keeps its watermark, keeps
computed and virtual
- * metadata columns that the schema no longer declares, and keeps its
primary key unless the
- * schema declares one.
+ * Submits this declaration with the semantics of {@code CREATE OR ALTER
MATERIALIZED TABLE}. It
Review Comment:
I restored the lifecycle on `execute()`, but only the parts that does not
give away too much implementation detail:
- a running refresh job is stopped with a savepoint and restarted without
restoring it, also for an unchanged declaration
- a suspended table stays suspended, and a later resume starts without state
- when the method returns.
Details that depend on how the refresh job is deployed are now addressed in
`table-api.md` (the savepoint directory option, `FULL` mode, the cancel and
rollback path, and that a rejected change leaves a running table suspended).
The docs page now also names `execution.checkpointing.savepoint-dir`, says that
a `FULL` table keeps its refresh workflow, and names a differing refresh
strategy as a rejection that leaves the table suspended.
--
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]