Skip to content

Conversation

@hantangwangd
Copy link
Member

Description

This PR add the developer documentation for procedures architecture in Presto, covering the development of both normal procedures and distributed procedures.

Motivation and Context

#26679
prestodb/rfcs#12

Impact

N/A

Test Plan

N/A

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

== NO RELEASE NOTE ==

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 28, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds developer documentation describing the architecture and implementation of normal and distributed procedures in Presto, and wires it into the main developer docs navigation.

File-Level Changes

Change Details Files
Introduce a new developer guide page documenting procedures and distributed procedures.
  • Create a new Sphinx documentation page dedicated to procedure architecture and lifecycle.
  • Describe how to implement standard procedures, including required interfaces, annotations, and wiring into a connector or plugin.
  • Document the design and execution flow of distributed procedures, including coordinator/worker responsibilities and message or task orchestration.
  • Outline best practices, limitations, and extension points for procedure authors.
presto-docs/src/main/sphinx/develop/procedures.rst
Hook the new procedures documentation into the existing developer docs structure.
  • Add a reference to the new procedures page in the main developer documentation index or navigation structure.
  • Ensure Sphinx can build the new page as part of the standard documentation build.
presto-docs/src/main/sphinx/develop.rst

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

@hantangwangd hantangwangd force-pushed the support_call_distributed_procedure_part2.5 branch from 7c0a466 to 08c3394 Compare November 29, 2025 09:40
@github-actions github-actions bot added the docs label Nov 29, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Unprioritized in Presto Documentation Nov 29, 2025
@hantangwangd hantangwangd marked this pull request as ready for review November 29, 2025 10:01
@hantangwangd hantangwangd requested review from a team, elharo and steveburnett as code owners November 29, 2025 10:01
Copy link
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 there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `presto-docs/src/main/sphinx/develop/procedures.rst:77` </location>
<code_context>
+
+.. note::
+
+  * The Java method corresponding to the ``MethodHandle`` have a correspondence with the procedure parameters. Its first parameter must be a session object
+    of type ``ConnectorSession.class``. The subsequent parameters must have a strict one-to-one correspondence in both type and order with the
+    procedure parameters declared in the arguments list.
</code_context>

<issue_to_address>
**issue (typo):** Fix grammar in the sentence about the Java method corresponding to the MethodHandle.

Since the subject is singular ("method"), use "has" instead of "have". You could also rephrase to: "The Java method corresponding to the ``MethodHandle`` must have a one-to-one correspondence with the procedure parameters," which aligns well with the next sentence.

```suggestion
  * The Java method corresponding to the ``MethodHandle`` must have a one-to-one correspondence with the procedure parameters. Its first parameter must be a session object
```
</issue_to_address>

### Comment 2
<location> `presto-docs/src/main/sphinx/develop/procedures.rst:433-434` </location>
<code_context>
+               Table icebergTable = procedureContext.getTable().orElseThrow(() -> new VerifyException("No partition data for partitioned table"));
+               IcebergTableHandle tableHandle = layoutHandle.getTable();
+
+               // Performs the preparatory work required when starting the execution of ``rewrite_data_files``,
+               // and encapsulate the necessary information and handling logic within the ``procedureContext``
+               ......
+
</code_context>

<issue_to_address>
**nitpick (typo):** Adjust verb agreement in the comment about preparatory work for `rewrite_data_files`.

Change "and encapsulate" to "and encapsulates" to match "Performs," or rephrase the sentence to avoid the mismatch. This is just a small grammar fix in the comment.

```suggestion
+               // Performs the preparatory work required when starting the execution of ``rewrite_data_files``,
+               // and encapsulates the necessary information and handling logic within the ``procedureContext``
```
</issue_to_address>

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.


.. note::

* The Java method corresponding to the ``MethodHandle`` have a correspondence with the procedure parameters. Its first parameter must be a session object
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (typo): Fix grammar in the sentence about the Java method corresponding to the MethodHandle.

Since the subject is singular ("method"), use "has" instead of "have". You could also rephrase to: "The Java method corresponding to the MethodHandle must have a one-to-one correspondence with the procedure parameters," which aligns well with the next sentence.

Suggested change
* The Java method corresponding to the ``MethodHandle`` have a correspondence with the procedure parameters. Its first parameter must be a session object
* The Java method corresponding to the ``MethodHandle`` must have a one-to-one correspondence with the procedure parameters. Its first parameter must be a session object

Comment on lines +433 to +434
// Performs the preparatory work required when starting the execution of ``rewrite_data_files``,
// and encapsulate the necessary information and handling logic within the ``procedureContext``
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick (typo): Adjust verb agreement in the comment about preparatory work for rewrite_data_files.

Change "and encapsulate" to "and encapsulates" to match "Performs," or rephrase the sentence to avoid the mismatch. This is just a small grammar fix in the comment.

Suggested change
// Performs the preparatory work required when starting the execution of ``rewrite_data_files``,
// and encapsulate the necessary information and handling logic within the ``procedureContext``
+ // Performs the preparatory work required when starting the execution of ``rewrite_data_files``,
+ // and encapsulates the necessary information and handling logic within the ``procedureContext``

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

Labels

Projects

Status: 🆕 Unprioritized

Development

Successfully merging this pull request may close these issues.

1 participant