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

Hangxiang Yu edited comment on FLINK-32275 at 6/8/23 2:21 AM:
--------------------------------------------------------------

Thanks for reporting this. I think it's really a problem.

It may cause some potential issues if users rely on this to wirte their codes.

I'd like to prepare a pr to make PartitionableListState behaves like the 
comment of AppendingState.

BTW, I also found some classes using it without any check, like 
SimpleSource#initializeState, which is also needed to be modified.

WDYT? [~Weijie Guo] 


was (Author: masteryhx):
Thanks for reporting this. I think it's really a problem.

I checked all implementations of ListState and found only 
PartitionableListState inconsistent.

It may cause some potential issues if users rely on this to wirte their codes.

I'd like to prepare a pr to make PartitionableListState behaves like the 
comment of AppendingState.

BTW, I also found some classes using it without any check, like 
SimpleSource#initializeState, which is also needed to be modified.


WDYT? [~Weijie Guo] 

> The return value of PartitionableListState#get is inconsistent with the 
> requirements of AppendingState
> ------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-32275
>                 URL: https://issues.apache.org/jira/browse/FLINK-32275
>             Project: Flink
>          Issue Type: Technical Debt
>          Components: Runtime / State Backends
>            Reporter: Weijie Guo
>            Assignee: Hangxiang Yu
>            Priority: Major
>
> The java doc of {{AppendingState#get()}} states that if the state is empty, 
> then this method should return {{null}}. But for it's child class 
> {{PartitionableListState}}, It does return a empty list instead of {{null}}. 
> This has caused some confusion ,especially {{AppendingState}} is a 
> {{PublicEvolving}} API.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to