[ https://issues.apache.org/jira/browse/FLINK-28214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17558338#comment-17558338 ]
Yi Tang commented on FLINK-28214: --------------------------------- Thanks [~Weijie Guo], let me describe it with some pseudocode. {code:java} serializer = ArrayDataSerializer() arr_a = CustomizedArrayData() bi_arr_a = serializer.copy(arr_a) // (1) arr_b = CustomizedArrayData() bi_arr_b = serializer.copy(arr_b) // (2) {code} For now, {{bi_arr_a}} and {{bi_arr_b}} will point to the same object, which is {{{}serializer.reuseArray{}}}. > ArrayDataSerializer can not be reused to copy customized type of array data > ---------------------------------------------------------------------------- > > Key: FLINK-28214 > URL: https://issues.apache.org/jira/browse/FLINK-28214 > Project: Flink > Issue Type: Improvement > Reporter: Yi Tang > Priority: Minor > > In FLINK-25238, we fix the ArrayDataSerializer to support copying customized > type of array data with similar way in MapDataSerializer. > The MapDataSerializer#toBinaryMap always contains copy semantics implicitly > but ArrayDataSerializer#toBinaryArray not. > So the returned value of ArrayDataSerializer#toBinaryArray will be covered by > new copied data. > We should always copy from the returned value of > ArrayDataSerializer#toBinaryArray in ArrayDataSerializer#copy explicitly. -- This message was sent by Atlassian Jira (v8.20.7#820007)