Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-24895

SqlTimestampSerializer#deserialize forgets to fully read from source when the record is null.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      As we support null Timestamp in this Serializer. In the 2 deserialize() methods, when we read the first long and get Long.MIN_VALUE, we directly return null and forget to read the next int which responds to nanos.

      If there is really a null Timestamp that has been serialized before, we may get wrong value when we deserialize the Object after this timestamp. So before return null,  source.skipBytesToRead(4) is needed to make the source in the right position.

      By the way, I find the copy(source, target) is implemented by deserialize the intermediate value, while its more efficient to just copy 12 bytes from source to target like target.write(source, 12).

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            bx123 bx123
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: