Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid behavior in TableIterator with hash-collided keys #41722

Merged

Conversation

nipunayf
Copy link
Contributor

@nipunayf nipunayf commented Nov 18, 2023

Purpose

The current implementation of the TableIterator does not consider hash collisions, as it treats its map implementations to have a one-to-one mapping. Hence, when there are hash-collided keys, the behavior produces invalid error messages.

Fixes #41717
Fixes #41719
Fixes #41721
Fixes #41819

Approach

The PR modifies the map implementation of the TableValue class to handle hash collisions in the iterator behavior.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@nipunayf nipunayf requested review from KavinduZoysa and gimantha and removed request for hasithaa, sameerajayasoma and warunalakshitha November 18, 2023 14:04
@nipunayf nipunayf changed the title Fix invalid behavior in TableIterator with hash-collided keys. Fix invalid behavior in TableIterator with hash-collided keys Nov 18, 2023
@nipunayf nipunayf changed the title Fix invalid behavior in TableIterator with hash-collided keys Fix invalid behavior in TableIterator with hash-collided keys Nov 18, 2023
Copy link

codecov bot commented Nov 18, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (43483c5) 76.67% compared to head (bb13478) 76.70%.
Report is 43 commits behind head on master.

Files Patch % Lines
...lerina/runtime/internal/values/TableValueImpl.java 94.44% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #41722      +/-   ##
============================================
+ Coverage     76.67%   76.70%   +0.02%     
+ Complexity    52929    52924       -5     
============================================
  Files          2881     2881              
  Lines        199440   199434       -6     
  Branches      25936    25939       +3     
============================================
+ Hits         152927   152976      +49     
+ Misses        38084    38012      -72     
- Partials       8429     8446      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nipunayf nipunayf requested a review from HindujaB December 4, 2023 07:39
@nipunayf nipunayf added the Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime label Dec 4, 2023
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Dec 19, 2023
@gimantha gimantha removed the Stale label Dec 20, 2023
Copy link
Contributor

@gimantha gimantha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nipunayf nipunayf force-pushed the fix-hash-collisions branch from cf9dada to bb13478 Compare January 2, 2024 06:28
@KavinduZoysa KavinduZoysa merged commit a09cc05 into ballerina-platform:master Jan 2, 2024
18 checks passed
@nipunayf nipunayf added this to the 2201.9.0 milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime
Projects
None yet
3 participants