You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Abhinav Agarwal (Jira)" <ji...@apache.org> on 2022/12/12 18:25:00 UTC

[jira] [Commented] (FLINK-23598) DataOutputSerializer.writeBytes updates position twice

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

Abhinav Agarwal commented on FLINK-23598:
-----------------------------------------

Hi I'd like to send a PR for this, seeing as this hasn't progressed since the last comment. Could I be assigned this ticket if there are no objections?

I've taken a stab here [https://github.com/apache/flink/compare/master...aagarwal-gtr:FLINK-23598?expand=1]

I've written a simple testcase here which fails with the existing code. I chose not to write a more elaborate testcase by adding a new {{String}} type in {color:#000000}{{SerializationTestTypeFactory}} since {{writeBytes(...)}} is a "special" case for ISO-8859 that has no corresponding read in {{DataInputStream}} and generally not used.  Happy to hear opinions.
{color}

> DataOutputSerializer.writeBytes updates position twice
> ------------------------------------------------------
>
>                 Key: FLINK-23598
>                 URL: https://issues.apache.org/jira/browse/FLINK-23598
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Core
>    Affects Versions: 1.13.0
>            Reporter: nihileon
>            Priority: Critical
>         Attachments: image-2021-08-03-16-07-17-790.png, image-2021-08-03-16-07-40-338.png, image-2021-08-03-16-08-09-249.png
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> DataOutputSerializer.writeBytes updates this.position twice, which only need to be update once.
> If the initiate position is 0 and I write a string of length 10, the position will be updated to 20.
> !image-2021-08-03-16-07-17-790.png|width=762,height=372!!image-2021-08-03-16-07-40-338.png|width=744,height=166!
> !image-2021-08-03-16-08-09-249.png|width=698,height=269!
>  
>  



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