Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++ stages/expressions and Constant value support #14588

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

wu-hui
Copy link
Contributor

@wu-hui wu-hui commented Mar 17, 2025

  1. Add stages and expressions in C++
  2. Use FSTUserDataReader to read constants

Copy link

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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@wu-hui wu-hui changed the title Push pqrpmwtupmwv Add C++ stages/expressions and Constant value support Mar 17, 2025
@wu-hui
Copy link
Contributor Author

wu-hui commented Mar 17, 2025

/gemini review

Copy link

@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 introduces C++ stages and expressions, along with constant value support using FSTUserDataReader. The changes touch several files, primarily in the Firestore/Source and Firestore/core directories. Overall, the changes seem well-structured and introduce important new functionality. However, there are several areas that could benefit from closer scrutiny and potential improvement.

Summary of Findings

  • Redundant isUserDataRead checks: The isUserDataRead flag and associated logic in FIRConstantBridge and FIRFunctionExprBridge seem redundant. The FSTUserDataReader should handle the parsing and caching of values, eliminating the need for manual tracking. This could be simplified.
  • Missing Copyright Header: The new files aggregate_expressions.h, aggregate_expressions.cc, ordering.h, and ordering.cc are missing the standard copyright header. This should be added for consistency.
  • Potential Memory Leak in encodeBlob: In FSTUserDataReader.mm, the encodeBlob method copies the blob using nanopb::CopyBytesArray, but it's unclear if the original ByteString's memory is properly managed. This could lead to a memory leak if not handled correctly.
  • Inconsistent use of std::move: There are some inconsistencies in the use of std::move. For example, in Where class constructor in stages.h, std::move is used for expr_, but not in CollectionSource constructor. Consistent use of std::move can improve performance.

Merge Readiness

While the pull request introduces valuable functionality, the issues identified, particularly the potential memory leak and redundant logic, should be addressed before merging. I am unable to approve this pull request, and it should be reviewed and approved by others before merging. Addressing the high and medium severity issues is highly recommended before merging.

@wu-hui wu-hui requested a review from cherylEnkidu March 17, 2025 17:34
@wu-hui wu-hui force-pushed the push-pqrpmwtupmwv branch 3 times, most recently from 4e8c9b7 to 5127bd0 Compare March 19, 2025 14:11
@wu-hui wu-hui force-pushed the push-pqrpmwtupmwv branch from 5127bd0 to 5d701f8 Compare March 20, 2025 18:17
@cherylEnkidu cherylEnkidu assigned wu-hui and unassigned cherylEnkidu Mar 24, 2025
@wu-hui wu-hui merged commit 15046ff into cheryllin/ppl Mar 24, 2025
20 of 31 checks passed
@wu-hui wu-hui deleted the push-pqrpmwtupmwv branch March 24, 2025 18:03
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.

3 participants