Arvid Heise created FLINK-40481:
-----------------------------------
Summary: SHOW CREATE MATERIALIZED TABLE displays a future
timestamp for FROM_NOW(<interval>) instead of past
Key: FLINK-40481
URL: https://issues.apache.org/jira/browse/FLINK-40481
Project: Flink
Issue Type: Bug
Components: Table SQL / API
Affects Versions: 2.3.0
Reporter: Arvid Heise
Assignee: Arvid Heise
{noformat}
CREATE MATERIALIZED TABLE mt
START_MODE = FROM_NOW(INTERVAL '3' MINUTE)
AS SELECT ...
SHOW CREATE TABLE mt;
-- START_MODE = FROM_NOW(INTERVAL '3' MINUTE) /* Evaluated to
FROM_TIMESTAMP(TIMESTAMP '2026-08-27 09:43:12') at execution */
{noformat}
Statement created at {{2026-08-27 09:40:12}}. The comment claims resolution to
{{09:43:12}} — three minutes in the future. The actual runtime resolution of
{{FROM_NOW(<interval>)}} reads from three minutes in the past (documented
semantics, matching Kafka's relative-offset behavior); only the {{SHOW CREATE}}
annotation is wrong.
{{ShowCreateUtil.extractStartMode}} builds the comment with:
{code:java}
LocalDateTime.now().plus(amount).toInstant(ZoneOffset.UTC)
{code}
which should be {{.minus(amount)}}. Introduced in FLINK-39323.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)