[
https://issues.apache.org/jira/browse/FLINK-39323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18070718#comment-18070718
]
Sergey Nuyanzin commented on FLINK-39323:
-----------------------------------------
Merged as
[b0d0d2e0c2978d48e53478356df6fce1be795b4d|https://github.com/apache/flink/commit/b0d0d2e0c2978d48e53478356df6fce1be795b4d]
> Support SHOW CREATE [OR ALTER] with relative time intervals for
> FROM_NOW(<interval_expression>)
> -----------------------------------------------------------------------------------------------
>
> Key: FLINK-39323
> URL: https://issues.apache.org/jira/browse/FLINK-39323
> Project: Flink
> Issue Type: Sub-task
> Reporter: Ramin Gharib
> Assignee: Sergey Nuyanzin
> Priority: Major
>
> When using relative time intervals (such as {{{}FROM_NOW(INTERVAL '7'
> DAY){}}}) for materialized table start modes, the expression is inherently
> non-idempotent because its evaluated value changes depending on when the
> command is run.
> To ensure clarity and maintain idempotency for users auditing or recreating
> tables, the {{SHOW CREATE [OR ALTER] MATERIALIZED TABLE}} command will output
> the user's original relative expression, but append an inline SQL comment
> containing the exact timestamp that was resolved at the time of execution.
> *Example:* If a user submits: {{START_MODE = FROM_NOW(INTERVAL '7' DAY)}}
> The {{SHOW CREATE OR ALTER}} output will render as: {{START_MODE =
> FROM_NOW(INTERVAL '7' DAY) /* Evaluated to FROM_TIMESTAMP(TIMESTAMP
> '2025-10-28 10:00:00') at execution */}}
> This approach preserves the user's original intent while providing the
> precise, deterministic timestamp used by the engine.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)