Skip to content

[Codemod][FbsourceThriftRemoveRefSuffix] ThriftRemoveRefSuffix_github_presto-trunk_presto-native-execution#27526

Open
meta-codesync[bot] wants to merge 1 commit intomasterfrom
export-D98901812
Open

[Codemod][FbsourceThriftRemoveRefSuffix] ThriftRemoveRefSuffix_github_presto-trunk_presto-native-execution#27526
meta-codesync[bot] wants to merge 1 commit intomasterfrom
export-D98901812

Conversation

@meta-codesync
Copy link
Copy Markdown

@meta-codesync meta-codesync Bot commented Apr 7, 2026

Reviewed By: iahs

Differential Revision: D98901812

Summary by Sourcery

Update Presto native execution code to use the new Thrift field accessors instead of *_ref() across tests and runtime components.

Enhancements:

  • Migrate TaskUpdateRequest tests to use modern Thrift field accessors for struct fields and optionals.
  • Update ThriftIO tests to construct and validate Thrift types via the new accessor API.
  • Adjust RestRemoteFunction response construction to populate Thrift payload and result using the new accessors.
  • Update BroadcastFile read/write logic to use the updated Thrift footer pageSizes accessor.

…_presto-trunk_presto-native-execution

Reviewed By: iahs

Differential Revision: D98901812
@meta-codesync meta-codesync Bot requested review from a team as code owners April 7, 2026 20:09
@linux-foundation-easycla
Copy link
Copy Markdown

CLA Missing ID CLA Not Signed

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 7, 2026

Reviewer's Guide

This codemod PR updates Presto native execution C++ tests and related code to use the new Thrift generated field accessors (e.g., field() and field().value()) instead of the deprecated field_ref() API, keeping Thrift interactions consistent with the updated codegen.

Class diagram for updated Thrift accessor usage in Presto native execution

classDiagram

class RestRemoteFunction {
  +makeRemoteCall(responseBody: IOBufUniquePtr) RemoteFunctionResponsePtr
}

class RemoteFunctionPage {
  +payload() IOBufUniquePtr&
}

class RemoteFunctionResponse {
  +result() RemoteFunctionPage&
}

RestRemoteFunction ..> RemoteFunctionPage : uses
RestRemoteFunction ..> RemoteFunctionResponse : uses
RemoteFunctionResponse o--> RemoteFunctionPage : contains

class BroadcastFileReader {
  +readFooter(filePath: string, pageSizes: vector<int64_t>&) void
}

class BroadcastFileWriter {
  -pageSizes_ : vector<int64_t>
  +writeFooter() void
}

class BroadcastFileFooter {
  +pageSizes() optional<vector<int64_t>>&
}

BroadcastFileReader ..> BroadcastFileFooter : reads
BroadcastFileWriter ..> BroadcastFileFooter : writes
Loading

File-Level Changes

Change Details Files
Replace deprecated Thrift _ref accessors with new Thrift field accessors in Presto native execution tests and runtime code.
  • Update Thrift struct field writes from field_ref() = value to field() = value across TaskUpdateRequest tests, including connector IDs, resource estimates, qualified object names, routine characteristics, output buffers, splits, writer targets, and session representation fields.
  • Adjust Thrift IO tests to construct and mutate Thrift objects using field() and nested field() assignments instead of *_ref() for host addresses, IDs, broadcast footers, and other primitives.
  • Update RestRemoteFunction to populate RemoteFunctionResponse and RemoteFunctionPage using the new payload() and result() accessors.
  • Change BroadcastFile footer read/write logic to use pageSizes() / .value() instead of pageSizes_ref() when handling BroadcastFileFooter in both reader and writer paths.
presto-native-execution/presto_cpp/main/tests/TaskUpdateRequestTest.cpp
presto-native-execution/presto_cpp/main/thrift/tests/ThriftIOTest.cpp
presto-native-execution/presto_cpp/main/functions/remote/RestRemoteFunction.cpp
presto-native-execution/presto_cpp/main/operators/BroadcastFile.cpp

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA c1858ef.
Ensure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants