You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (Jira)" <ji...@apache.org> on 2026/04/17 15:11:00 UTC
[jira] [Commented] (FLINK-39256) Support ORDER BY clause in PTFs
[ https://issues.apache.org/jira/browse/FLINK-39256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18074276#comment-18074276 ]
Timo Walther commented on FLINK-39256:
--------------------------------------
Fixed in master: 3afaa8cf645e39559b5e01d8ef2ae143846b161a
> Support ORDER BY clause in PTFs
> -------------------------------
>
> Key: FLINK-39256
> URL: https://issues.apache.org/jira/browse/FLINK-39256
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API, Table SQL / Planner, Table SQL / Runtime
> Reporter: Timo Walther
> Assignee: Timo Walther
> Priority: Major
> Labels: pull-request-available
>
> Support the ORDER BY clause for time attributes in PTF table arguments. By defining a SQL like:
> {code}
> SELECT * FROM MyPtf(input => TABLE t PARTITION BY k ORDER BY ts)
> {code}
> A temporal sort operation is inserted that leads to similar behavior as for
> {code}
> MATCH_RECOGNIZE(PARTITION BY userid ORDER BY ts)
> {code}
> in StreamExecMatch which also drops late data.
> The ORDER BY supports sorting on multiple columns (e.g. ORDER BY ts ASC, c2 ASC, c3 DESC), however, the first column must be a watermarked time attribute in ascending order. In case of multiple table arguments, the ORDER BY is executed per input table (as a sorting operator before the executing PTF operator).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)