Conversation
|
Warning: This pull request is touching the following templated files:
|
46ed5ab to
7acdb11
Compare
d504667 to
d0f184a
Compare
...-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/SubcollectionSource.java
Outdated
Show resolved
Hide resolved
...-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/SubcollectionSource.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineSubqueryTest.java
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
Show resolved
Hide resolved
...loud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java
Show resolved
Hide resolved
| @InternalApi | ||
| public FunctionExpression(String name, List<? extends Expression> params) { |
There was a problem hiding this comment.
Why do we make this internal?
| bookDocs = | ||
| ImmutableMap.<String, Map<String, Object>>builder() | ||
| .put( | ||
| "book1", | ||
| ImmutableMap.<String, Object>builder() | ||
| .put("title", "The Hitchhiker's Guide to the Galaxy") | ||
| .put("author", "Douglas Adams") | ||
| .put("genre", "Science Fiction") | ||
| .put("published", 1979) |
There was a problem hiding this comment.
It looks like this is a copy of the bookDocs from the ITPipelineTest.java setup. Can you pull this setup code out from both of these places and put it into a function that we can reuse in both places? Maybe we could remove ~150 LOC from here.
There was a problem hiding this comment.
I am skeptical about consolidating test setup here. While it serves to remove some duplication, we are talking about tests here, and having all test data ready in the same file has benefits to both human and agents.
I do want to see the multiple review collections we setup in the individual tests to be moved in here. That is, we setup both the books, and reviews or some other collections here. The number of documents can be shrinked, like 3,4 books and their reviews might be enough.
| @@ -0,0 +1,36 @@ | |||
| /* | |||
| * Copyright 2024 Google LLC | |||
| @@ -0,0 +1,39 @@ | |||
| /* | |||
| * Copyright 2025 Google LLC | |||
| bookDocs = | ||
| ImmutableMap.<String, Map<String, Object>>builder() | ||
| .put( | ||
| "book1", | ||
| ImmutableMap.<String, Object>builder() | ||
| .put("title", "The Hitchhiker's Guide to the Galaxy") | ||
| .put("author", "Douglas Adams") | ||
| .put("genre", "Science Fiction") | ||
| .put("published", 1979) |
There was a problem hiding this comment.
I am skeptical about consolidating test setup here. While it serves to remove some duplication, we are talking about tests here, and having all test data ready in the same file has benefits to both human and agents.
I do want to see the multiple review collections we setup in the individual tests to be moved in here. That is, we setup both the books, and reviews or some other collections here. The number of documents can be shrinked, like 3,4 books and their reviews might be enough.
feat: add support for Pipeline subqueries
This PR introduces support for Pipeline Subqueries, allowing users to perform complex data transformations and aggregations on subcollections within a pipeline.
Key Features
Pipeline.subcollection(String path)to initiate a pipeline on a subcollection of the current document.Pipeline.define(...)to bind values to variables for reuse within the pipeline scope.Expression.currentDocument(): Reference the current document in a pipeline stage.Expression.variable(String name): Access defined variables.Pipeline.toArrayExpression()andPipeline.toScalarExpression(): Convert subquery results into array or scalar expressions for use in parent pipelines.Testing
ITPipelineSubqueryTest.javacontaining integration tests for subquery functionality.