apache / apache/beam

InMemoryStateInternals MapState / SetState should use StructuralValue for membership / key comparison checks

Open
#18,427 0 comments 0 reactions 0 assignees View on GitHub
bug core direct P3 runners
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
205

Description

InMemoryStateInternals SetState incorrectly compares set membership by using object equality instead of the structural value.

InMemoryStateInternals MapState incorrectly compares key membership based upon key equality instead of structural value of the key equality.

This impacts DirectRunner.

Adding tests which uses byte arrays as the object within the set state and also byte arrays as the keys within a map state would exercise this failure condition.

Imported from Jira [BEAM-2777](https://issues.apache.org/jira/browse/BEAM-2777). Original Jira may contain additional context.
Reported by: lcwik.

Contributor guide

Open the contributing guide

Research direction

Locate the InMemoryStateInternals SetState and MapState implementations and the DirectRunner tests. Add cases using byte arrays in set state and as map keys, then verify membership and key comparisons use StructuralValue and the tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.