Hi! It depends on the state backend you use. For example if you use a heap memory state backend it is backed by a hash map and it uses the hash code of byte[] to compare the two byte[] (see HeapMapState#put). However for rocksdb state backend it uses the serialized bytes (that is to say, the content of byte[]) to compare with the records and thus two byte[] with the same content can match (see RocksDBMapState#put).
Dan Hill <quietgol...@gmail.com> 于2021年9月24日周五 上午7:43写道: > *Context* > I want to perform joins based on UUIDs. String version is less efficient > so I figured I should use the byte[] version. I did a shallow dive into > the Flink code I'm not sure it's safe to use byte[] as a key (since it uses > object equals/hashcode). > > *Request* > How do other Flink devs do for byte[] keys? I want to use byte[] as a key > in a MapState. > > >