thswlsqls opened a new issue, #8535:
URL: https://github.com/apache/paimon/issues/8535
# [Bug] Internal map equality uses Java key lookup for binary keys
**Describe the bug**
`InternalRowUtils.equals` compares standalone `byte[]` values by content,
but its `InternalMap` branch checks keys with Java `Map.containsKey` and
`Map.get`.
For `MAP<BINARY, ...>`, two separate `byte[]` key objects with identical
bytes are therefore treated as different keys.
**To Reproduce**
Compare two `GenericMap` instances with `DataTypes.MAP(DataTypes.BINARY(2),
DataTypes.INT())`; each map contains one key `{1, 2}` and value `1`, but the
key arrays are different objects.
**Expected behavior**
The maps should compare equal because binary keys have the same logical
bytes and values match.
**Actual behavior**
The maps compare unequal because Java arrays use reference equality for map
lookup.
**Additional context**
The value comparison path already handles `byte[]` with `Arrays.equals`; map
key comparison should use the same typed equality path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]