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

Make NodeMap Thread-safe #487

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Make NodeMap Thread-safe #487

wants to merge 5 commits into from

Conversation

am357
Copy link
Contributor

@am357 am357 commented Aug 14, 2024

Description of changes:

Makes the NodeMap thread-safe; this is a per-requisite for using the structure in the PartiQLShapeBuilder. It uses DashMap and Vec under the hood. It uses the Vec for preserving the ordering as the previous implementation was using IndexMap. IndexMap does not seem to be thread-safe.

The PR also makes necessary changes to preserve the behavior of the current NodeMap dependencies.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This PR
- adds `NodeId` to `StaticType`.
- makes `AutoNodeIdGenerator` thread-safe
- adds `PartiqlShapeBuilder` and moves some `PartiqlShape` APIs to it; this is to be able to generate unique `NodeId`s for a `PartiqlShape` that includes static types that themselves can include other static types.
- adds a static thread safe `shape_builder` function that provides a convenient way for using `PartiqlShapeBuilder` for creating new shapes.
- prepends existing type macros with `type` such as `type_int!` to make macro names more friendly.
- removes `const` PartiQL types under `partiql-types` in favor of `PartiqlShapeBuilder`.
@am357 am357 marked this pull request as ready for review August 14, 2024 22:33
@am357 am357 requested a review from jpschorr August 14, 2024 22:33
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 61.53846% with 10 lines in your changes missing coverage. Please review.

Project coverage is 80.95%. Comparing base (7203852) to head (28fed58).

Files Patch % Lines
partiql-common/src/node.rs 61.53% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
- Coverage   80.98%   80.95%   -0.03%     
==========================================
  Files          69       69              
  Lines       18796    18822      +26     
  Branches    18796    18822      +26     
==========================================
+ Hits        15221    15237      +16     
- Misses       3131     3141      +10     
  Partials      444      444              

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

Copy link

Conformance comparison report

Base (7203852) f286311 +/-
% Passing 90.35% 90.35% 0.00%
✅ Passing 5731 5731 0
❌ Failing 612 612 0
🔶 Ignored 0 0 0
Total Tests 6343 6343 0

Number passing in both: 5731

Number failing in both: 612

Number passing in Base (7203852) but now fail: 0

Number failing in Base (7203852) but now pass: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant