http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/BinaryRowDataUtil-EMPTY-ROW-was-changed-unexpectedly-tp43630p43636.html
My code will modify the key got from KeySelector by updating its RowKind.
key[1], but EmptyRowDataKeySelector always returns the same object[2].
> This is a bit concerning. Could you re-run your test with enabled
> assertions and/or modify BinaryRowData#assertIndexIsValid to always
> throw an error if one of the 2 assertions is not met?
>
> On 5/11/2021 9:37 AM, Smile wrote:
>> Hi all,
>>
>> I'm trying to add mini-batch optimizations for Regular Join
>> (flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/join/stream/StreamingJoinOperator.java)
>> in Blink planner. And there're some test cases that failed, such as
>> AggregateITCase.testGroupBySingleValue.
>>
>> After debugging, I found the corresponding heap memory for
>> BinaryRowDataUtil.EMPTY_ROW was changed unexpectedly, from
>> [0,0,0,0,0,0,0,0]
>> to [3,0,0,0,0,0,0,0], and lead to some records being set to a wrong key.
>>
>> However, my mini-batch code doesn't have any low-level operators with
>> MemorySegment. I only buffered some records (RowData) in a Map just like
>> AbstractMapBundleOperator did. Object reuse was also disabled by
>> env.getConfig.disableObjectReuse(). It looks like there's something wrong
>> when StreamOneInputProcessor.processInput changed the memory segments
>> that
>> do not belong to it (belong to BinaryRowDataUtil.EMPTY_ROW instead). The
>> debugging page with more information was attached.
>>
>> I'm not familiar with org.apache.flink.core.memory.MemorySegment or
>> sun.misc.Unsafe, so I'd like to ask maillist for help. Do you have any
>> ideas
>> about why it happens or where to check next?
>>
>> Thank you.
>>
>> Smile
>>
>> <
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/t2787/EmptyRowDebug-20210511-1.png>>>
>>
>>
>> --
>> Sent from:
>>
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/