[
https://issues.apache.org/jira/browse/FLINK-35792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896533#comment-17896533
]
xuyang commented on FLINK-35792:
--------------------------------
[~jhughes] Regarding 3.2, yes, we need to at least make similar adjustments to
the all existing rank functions. I'm not sure if it's necessary to split the
original functions in two(that would be quite more difficult to maintain...).
As for 3.1, as far as I know, there isn't any existing implementation similar
to this. It does feel a bit hack, which is also the reason for my hesitation.
I lean towards options 1 and 2 because, until we support this capability (even
if the syntax is valid, the operator doesn't actually support it), we can at
least prevent users from using implicit and problematic SQL. WDYT?
> Sorting by proctime does not work in rank
> -----------------------------------------
>
> Key: FLINK-35792
> URL: https://issues.apache.org/jira/browse/FLINK-35792
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 1.20.0, 1.19.1
> Reporter: xuyang
> Assignee: xuyang
> Priority: Major
>
> Take the following sql as an example:
> {code:java}
> @Test
> def test(): Unit = {
> val sql =
> """
> |SELECT *
> |FROM (
> | SELECT a, b, c,
> | ROW_NUMBER() OVER (PARTITION BY a ORDER BY b, proctime DESC) as
> rank_num
> | FROM MyTable)
> |WHERE rank_num = 1
> """.stripMargin
> // This rank can't be converted into Deduplicated because it also uses `b`
>
> // as order key.
> util.verifyExecPlan(sql)
> } {code}
> The rank node will not materialize the `proctime` in
> `RelTimeIndicatorConverter`, thus the order key `proctime` is always null.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)