Skip to content

fix: Update native protocol code updates and apply format fixes missed in previous PRs. - #43

Merged
anlowee merged 3 commits into
y-scope:release-0.293-clp-connectorfrom
anlowee:xwei/fix-format
Jul 21, 2025
Merged

fix: Update native protocol code updates and apply format fixes missed in previous PRs.#43
anlowee merged 3 commits into
y-scope:release-0.293-clp-connectorfrom
anlowee:xwei/fix-format

Conversation

@anlowee

@anlowee anlowee commented Jul 17, 2025

Copy link
Copy Markdown

Description

Typically we should run make format-fix under presto-native-execution/ when we make any Presttimo changes. However, we didn't run it for the last few PRs.

When update the protocol, we should run make presto_protocol under presto-native-execution/presto_cpp/presto_protocol instead of manually run the code generation commands. Since we forgot to do so, there were some hive connector related protocol changes didn't get updated correctly.

In this PR, we run make format-fix and make presto_protocol to fix the format issues as well as the protocol inconsistency.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Passed the CI.

Summary by CodeRabbit

  • New Features

    • Added support for the optional catalog name field in Hive table protocol handling, allowing more detailed table identification.
  • Style

    • Improved formatting and clarity of comments in build configuration files for better readability.

@coderabbitai

coderabbitai Bot commented Jul 17, 2025

Copy link
Copy Markdown

Walkthrough

Stylistic and formatting improvements were made to several CMakeLists.txt files without affecting build logic. In the Hive protocol, a new optional field, catalogName, was added to the Table struct, and its handling was integrated into the JSON serialization and deserialization functions.

Changes

File(s) Change Summary
presto-native-execution/CMakeLists.txt
presto-native-execution/presto_cpp/main/CMakeLists.txt
Reformatted and clarified comments; no changes to build logic or functionality.
presto-native-execution/presto_cpp/presto_protocol/connector/hive/presto_protocol_hive.h Added optional catalogName field to the Table struct.
presto-native-execution/presto_cpp/presto_protocol/connector/hive/presto_protocol_hive.cpp Updated to_json and from_json for Table to handle the new catalogName field.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Table (Hive Protocol)
    participant JSON

    User->>Table (Hive Protocol): Set or get Table object (with optional catalogName)
    Table (Hive Protocol)->>JSON: to_json(Table) serializes catalogName (if present)
    JSON->>Table (Hive Protocol): from_json(JSON) deserializes catalogName (if present)
Loading

Estimated code review effort

2 (~15 minutes)

Suggested reviewers

  • wraymo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Comment on lines -72 to +74
# Set all Velox options below
# Make sure that if we include folly headers or other dependency headers
# that include folly headers we turn off the coroutines and turn on int128.
# Set all Velox options below.

# Make sure that if we include folly headers or other dependency headers that
# include folly headers we turn off the coroutines and turn on int128.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think the orignal comments (in prestodb master branch) are not formatted well so the clang-format is trying to fix this issue. I changed it a bit according to this line: https://github.com/y-scope/presto/pull/43/files#diff-f4770996c945761a121b4351ae31adecae46b00a0767c8c4cb04112731984795R45

@anlowee
anlowee requested review from kirkrodrigues and wraymo July 17, 2025 20:03
wraymo
wraymo previously approved these changes Jul 18, 2025
Comment thread presto-native-execution/presto_cpp/main/CMakeLists.txt Outdated
Comment thread presto-native-execution/CMakeLists.txt Outdated
anlowee and others added 2 commits July 21, 2025 10:28
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41225a7 and 938f7c1.

📒 Files selected for processing (2)
  • presto-native-execution/CMakeLists.txt (3 hunks)
  • presto-native-execution/presto_cpp/main/CMakeLists.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: anlowee
PR: y-scope/presto#7
File: .github/workflows/hive-tests.yml:33-35
Timestamp: 2025-06-04T14:50:43.554Z
Learning: In the y-scope/presto repository, GitHub workflows are extended from OSS Presto and should maintain consistent formatting with the upstream patterns, including YAML indentation styles for workflow steps.
presto-native-execution/CMakeLists.txt (2)

Learnt from: anlowee
PR: #7
File: .github/workflows/hive-tests.yml:33-35
Timestamp: 2025-06-04T14:50:43.554Z
Learning: In the y-scope/presto repository, GitHub workflows are extended from OSS Presto and should maintain consistent formatting with the upstream patterns, including YAML indentation styles for workflow steps.

Learnt from: anlowee
PR: y-scope/presto#0
File: :0-0
Timestamp: 2025-06-19T08:41:46.288Z
Learning: In the y-scope/presto repository, prefer static imports for commonly used methods like String.format(). Instead of writing String.format("%s", value), use static import import static java.lang.String.format; and call format("%s", value) directly.

🔇 Additional comments (4)
presto-native-execution/presto_cpp/main/CMakeLists.txt (1)

204-205: LGTM – split long list for readability only.

The re-wrapped set(PROXYGEN_LIBRARIES …) preserves the same contents; no build impact.

presto-native-execution/CMakeLists.txt (3)

32-40: LGTM – comment reflow only.

The bullet list describing disabled warnings is clearer now; build flags unchanged.


73-76: LGTM – clarified Velox options comment.

Purely stylistic; no functional impact.


204-205: LGTM – library list formatting only.

Line split improves readability; link order preserved.

Comment on lines +114 to 120
# velox_tpch_connector is an OBJECT target in Velox and so needs to be linked to
# the executable or use TARGET_OBJECT linkage for the presto_server_lib target.
# However, we also would need to add its dependencies (tpch_gen etc).
# TODO change the target in Velox to a library target then we can move this to the
#
# TODO change the target in Velox to a library target then we can move this to
# the presto_server_lib.
# presto_server_lib.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Remove stray duplicate comment line.

Line 120 repeats the fragment “presto_server_lib.” that is already covered in the previous sentence and adds no value. Trimming it keeps the comment block tidy.

-# presto_server_lib.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# velox_tpch_connector is an OBJECT target in Velox and so needs to be linked to
# the executable or use TARGET_OBJECT linkage for the presto_server_lib target.
# However, we also would need to add its dependencies (tpch_gen etc).
# TODO change the target in Velox to a library target then we can move this to the
#
# TODO change the target in Velox to a library target then we can move this to
# the presto_server_lib.
# presto_server_lib.
# velox_tpch_connector is an OBJECT target in Velox and so needs to be linked to
# the executable or use TARGET_OBJECT linkage for the presto_server_lib target.
# However, we also would need to add its dependencies (tpch_gen etc).
#
# TODO change the target in Velox to a library target then we can move this to
# the presto_server_lib.
🤖 Prompt for AI Agents
In presto-native-execution/presto_cpp/main/CMakeLists.txt around lines 114 to
120, remove the duplicate fragment "presto_server_lib." on line 120 from the
comment block to avoid redundancy and keep the comments clean and concise.

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the PR title, how about:

fix: Update native protocol code updates and apply format fixes missed in previous PRs.

@anlowee anlowee changed the title fix: Fix the format and update the presto protocol. fix: Update native protocol code updates and apply format fixes missed in previous PRs. Jul 21, 2025
@anlowee
anlowee merged commit 6613d6c into y-scope:release-0.293-clp-connector Jul 21, 2025
@anlowee
anlowee deleted the xwei/fix-format branch July 21, 2025 22:14
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.

3 participants