Skip to content

chore: remove GrpcQueryHandler::put_record_batch#7844

Merged
killme2008 merged 1 commit intoGreptimeTeam:mainfrom
v0y4g3r:refactor/remove-unused-trait-method
Mar 23, 2026
Merged

chore: remove GrpcQueryHandler::put_record_batch#7844
killme2008 merged 1 commit intoGreptimeTeam:mainfrom
v0y4g3r:refactor/remove-unused-trait-method

Conversation

@v0y4g3r
Copy link
Copy Markdown
Contributor

@v0y4g3r v0y4g3r commented Mar 22, 2026

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

As title

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

…ueryHandler::handle_put_record_batch_stream instead

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on refining the gRPC query handling interface by eliminating the put_record_batch method. This removal simplifies the API by deprecating a specific single-batch record insertion mechanism, likely in favor of a more unified or streaming approach for data ingestion. The change primarily involves removing code and associated imports, contributing to a cleaner and more focused codebase.

Highlights

  • Method Removal: The put_record_batch async function has been entirely removed from the GrpcQueryHandler trait and its implementations.
  • Code Cleanup: Associated imports such as common_base::AffectedRows and table::TableRef were removed from relevant files as they are no longer needed after the method's removal.
  • Interface Simplification: This change streamlines the gRPC query handling interface by removing a specific single-batch insertion method, potentially consolidating record batch insertion logic into the existing streaming method.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Mar 22, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the unused GrpcQueryHandler::put_record_batch method and its implementations. The changes are straightforward and correctly remove the dead code from the GrpcQueryHandler trait, its implementation in Instance, and the corresponding test mock. This cleanup simplifies the codebase by removing an unused code path for non-streaming batch puts via gRPC.

@v0y4g3r v0y4g3r marked this pull request as ready for review March 23, 2026 02:43
@v0y4g3r v0y4g3r requested a review from a team as a code owner March 23, 2026 02:43
Copilot AI review requested due to automatic review settings March 23, 2026 02:43
Copy link
Copy Markdown
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

Removes the now-unneeded GrpcQueryHandler::put_record_batch API in favor of the streaming-based bulk insert path, and updates implementations accordingly.

Changes:

  • Removed put_record_batch from the GrpcQueryHandler trait.
  • Dropped the corresponding (previously unimplemented!() / unused) implementations in frontend and test dummy handler.
  • Cleaned up now-unused imports (AffectedRows, TableRef, PutRecordBatchRequest).

Reviewed changes

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

File Description
src/servers/src/query_handler/grpc.rs Removes put_record_batch from the public GrpcQueryHandler trait and related imports.
src/frontend/src/instance/grpc.rs Removes the put_record_batch impl from Instance; relies on handle_put_record_batch_stream.
src/servers/tests/mod.rs Removes the dummy put_record_batch impl and AffectedRows import in tests.
Comments suppressed due to low confidence (1)

src/servers/src/query_handler/grpc.rs:40

  • Removing put_record_batch from the public GrpcQueryHandler trait is a breaking API change for any downstream implementors of the servers crate. If this trait is intended to be part of the public API, the PR checklist item "API changes are backward compatible" should be updated (or the trait should be made non-public / sealed to indicate it’s internal).
#[async_trait]
pub trait GrpcQueryHandler {
    async fn do_query(&self, query: Request, ctx: QueryContextRef) -> Result<Output>;

    fn handle_put_record_batch_stream(
        &self,
        stream: PutRecordBatchRequestStream,
        ctx: QueryContextRef,
    ) -> Pin<Box<dyn Stream<Item = Result<DoPutResponse>> + Send>>;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@killme2008 killme2008 added this pull request to the merge queue Mar 23, 2026
Merged via the queue into GreptimeTeam:main with commit 72f289d Mar 23, 2026
92 of 93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required This change does not impact docs. size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants