Skip to content

MOD-10187 Refactor Refactor RLookup_GetKey* C interface for porting#6345

Merged
JonasKruckenberg merged 5 commits intomasterfrom
push-tvzmkrozsotw
Jun 23, 2025
Merged

MOD-10187 Refactor Refactor RLookup_GetKey* C interface for porting#6345
JonasKruckenberg merged 5 commits intomasterfrom
push-tvzmkrozsotw

Conversation

@JonasKruckenberg
Copy link
Collaborator

Describe the changes in the pull request

This refactor this RLookup C interface to make porting to Rust easier. In particular it
replaces the RLookup_GetKey/RLookup_GetKeyEx functions which have their behavior controlled through the mode argument with mode-specific aliases: RLookup_GetKey_Read/RLookup_GetKey_ReadEx and RLookup_GetKey_Write/RLookup_GetKey_WritEx.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.93%. Comparing base (f338602) to head (4b2a7b8).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6345      +/-   ##
==========================================
+ Coverage   88.92%   88.93%   +0.01%     
==========================================
  Files         247      250       +3     
  Lines       41291    41366      +75     
  Branches     3483     3556      +73     
==========================================
+ Hits        36718    36789      +71     
+ Misses       4530     4528       -2     
- Partials       43       49       +6     
Flag Coverage Δ
flow 81.49% <100.00%> (-0.14%) ⬇️
unit 46.98% <60.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raz-mon raz-mon requested a review from Copilot June 23, 2025 11:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the RLookup C interface to simplify porting to Rust by replacing the overloaded RLookup_GetKey functions with mode‐specific variants.

  • Replaces RLookup_GetKey/RLookup_GetKeyEx with RLookup_GetKey_Read/Write (and their Ex variants) across the codebase
  • Updates documentation and implementation in header and source files to reflect the new API design

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/cpptests/test_cpp_rlookup.cpp Updated test cases to use the new read/write aliases
tests/cpptests/test_cpp_resultprocessor.cpp Replaced function calls with the mode-specific write alias
tests/cpptests/test_cpp_expr.cpp Adjusted key retrieval functions to use the new API variant
tests/cpptests/test_cpp_agg.cpp Modified test functions to use new API variants in aggregation tests
src/spec.c Replaced RLookup_GetKeyEx with its read-specific variant
src/rlookup.h Updated function declarations and documentation for the new API
src/rlookup.c Modified function implementations to call the common helper with proper mode flags
src/coord/dist_plan.cpp Changed key retrieval calls to use the write alias
src/aggregate/reducer.c Replaced read mode API call with the new read-specific function
src/aggregate/expr/expression.c Updated property lookup to use the read alias
src/aggregate/aggregate_request.c Adjusted both source and destination key lookups using new API
src/aggregate/aggregate_exec.c Updated key calls in serialization to use the read-specific variant
Comments suppressed due to low confidence (1)

src/rlookup.h:209

  • [nitpick] The documentation for the new mode-specific functions (RLookup_GetKey_Read, RLookup_GetKey_Write, etc.) is very similar. Consider adding clarifying details that explicitly describe the behavioral differences between these functions to improve readability and maintainability.
 * Get a RLookup key for a given name.

Copy link
Collaborator

@raz-mon raz-mon left a comment

Choose a reason for hiding this comment

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

My main question: Why is this better than binding the enum and using it in the Rust code?
Also, one typo that existed before..

Co-authored-by: Raz Monsonego <[email protected]>
Copy link
Collaborator

@raz-mon raz-mon left a comment

Choose a reason for hiding this comment

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

👌

@JonasKruckenberg JonasKruckenberg added this pull request to the merge queue Jun 23, 2025
Merged via the queue into master with commit 6a0c9d8 Jun 23, 2025
15 checks passed
@JonasKruckenberg JonasKruckenberg deleted the push-tvzmkrozsotw branch June 23, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants