[ 
https://issues.apache.org/jira/browse/FLINK-35792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896513#comment-17896513
 ] 

Jim Hughes commented on FLINK-35792:
------------------------------------

Hi [~xuyangzhong], thank you for the context! 

With that context, I can appreciate the concerns about materializing the 
proctime column.

As a principle, I'd like to see Flink be able to handle all reasonable SQL 
statements.  I imagine that may not always be possible.  

With that goal in mind, I am not sure if option 1 makes sense.  I find the 
syntax above reasonable.  Relative to option 4, given what you pointed out 
about materialization, I think that one could write a statement where 
materialization would lead to another error.

Relative to 3.2, this sounds like it may run into the issue described in 
Solution 2 on 
[FLINK-34702|https://issues.apache.org/jira/browse/FLINK-34702?focusedCommentId=17828590&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17828590]
 where two times as many functions need to be written.

Relative to 3.1, this sounds interesting.  Is this something which has been 
done for other cases?  

> 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)

Reply via email to