Skip to content

[Bug] Internal map equality uses Java key lookup for binary keys #8535

Description

@thswlsqls

[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions