Dawid Wysakowicz created FLINK-36665:
----------------------------------------
Summary: WINDOW_START, WINDOW_END always return TIMESTAMP(3)
Key: FLINK-36665
URL: https://issues.apache.org/jira/browse/FLINK-36665
Project: Flink
Issue Type: Bug
Components: Table SQL / API
Reporter: Dawid Wysakowicz
Assignee: Dawid Wysakowicz
Fix For: 2.0.0
The type inference for {{WINDOW_START}} and {{WINDOW_END}} is constant and
always {{TIMESTAMP(3)}}
On the other hand {{WINDOW_TIME}} produces {{TIMESTAMP(3)}} or
{{TIMESTAMP_LTZ(3)}} depending on the time attribute type.
This leads to a confusing behaviour e.g. a query like:
{code}
SELECT
window_start,
window_end,
window_time,
SUM(price)
FROM
TABLE(CUMULATE(
TABLE bid_t,
DESCRIPTOR(bid_time),
INTERVAL '5' SECOND,
INTERVAL '10' SECOND))
GROUP BY window_start, window_end, window_time
{code}
produces:
{code}
2024-01-01T13:00, 2024-01-01T13:00:05, 2024-01-01T12:00:04.999Z, 4.00
{code}
See that the first two columns return `13:00` hour whereas the last `12:00`.
I suggest all window properties return type based on the input time attribute.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)