Skip to content

feat: Add subquery support in pipeline#7736

Merged
cherylEnkidu merged 63 commits intomainfrom
cheryl/subquery
Mar 27, 2026
Merged

feat: Add subquery support in pipeline#7736
cherylEnkidu merged 63 commits intomainfrom
cheryl/subquery

Conversation

@cherylEnkidu
Copy link
Copy Markdown
Contributor

@cherylEnkidu cherylEnkidu commented Feb 11, 2026

Summary

This PR implements the Query Pipeline Subquery API in the Android SDK, enabling complex data retrieval patterns including joins, aggregations on related collections, and value binding.

New API

Pipeline

  • define(aliasedExpression: AliasedExpression, ...): Defines one or more variables in the pipeline's scope for internal reuse.
  • define(stage: DefineStage): Overload for defining variables using a DefineStage object.
  • toScalarExpression(): Converts the pipeline into an expression that evaluates to a single scalar result.
  • toArrayExpression(): Converts the pipeline into an expression that evaluates to an array of results.
  • subcollection(path: String): Initializes a pipeline scoped to a subcollection for use in subqueries.
  • subcollection(source: SubcollectionSource): Overload for creating subcollection pipelines with a specific source.

Expression

  • variable(name: String): Creates an expression that refers to a variable defined in the pipeline scope.
  • currentDocument(): Creates an expression that refers to the current document being processed.

Implementation Details

  • toScalarExpression and toArrayExpression handle the execution of sub-pipelines and format the results based on the output structure (unwrapping single fields or returning maps for multiple fields).
  • Validations are added to ensure relative subcollection pipelines are used correctly within a parent context.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2026

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@cherylEnkidu cherylEnkidu changed the base branch from main to cheryllin/fixRaceCondition February 13, 2026 20:41
Base automatically changed from cheryllin/fixRaceCondition to main February 13, 2026 21:53
@firebase firebase deleted a comment from google-oss-bot Feb 13, 2026
wu-hui
wu-hui previously approved these changes Mar 20, 2026
Copy link
Copy Markdown
Contributor

@wu-hui wu-hui left a comment

Choose a reason for hiding this comment

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

Couple nits on documentation, LGTM!

@wu-hui wu-hui assigned cherylEnkidu and unassigned wu-hui Mar 20, 2026
wu-hui
wu-hui previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

@wu-hui wu-hui left a comment

Choose a reason for hiding this comment

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

Approved.

@cherylEnkidu cherylEnkidu enabled auto-merge (squash) March 27, 2026 18:32
@cherylEnkidu cherylEnkidu merged commit afbe8b9 into main Mar 27, 2026
28 of 29 checks passed
@cherylEnkidu cherylEnkidu deleted the cheryl/subquery branch March 27, 2026 18:42
Copy link
Copy Markdown

@markarndt markarndt left a comment

Choose a reason for hiding this comment

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

Approved.

@github-actions github-actions bot mentioned this pull request Mar 28, 2026
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.

5 participants