Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 49183e0

Browse files
committed
Merge remote-tracking branch 'origin/cheryl/subquery' into cheryl/subquery
# Conflicts: # google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java # google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java # google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java
2 parents 7acdb11 + e87720e commit 49183e0

10 files changed

Lines changed: 31 additions & 414 deletions

File tree

.github/CODEOWNERS

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
# For syntax help see:
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

7-
# The @googleapis/api-firestore @googleapis/firestore-dpe is the default owner for changes in this repo
8-
* @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
7+
# The @googleapis/firestore-team is the default owner for changes in this repo
8+
* @googleapis/cloud-sdk-java-team @googleapis/firestore-team
99

1010
# for handwritten libraries, keep codeowner_team in .repo-metadata.json as owner
11-
**/*.java @googleapis/api-firestore @googleapis/firestore-dpe
11+
**/*.java @googleapis/firestore-team
1212

1313
# For generated Java code
14-
proto-*/ @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
15-
grpc-*/ @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
14+
proto-*/ @googleapis/cloud-sdk-java-team @googleapis/firestore-team
15+
grpc-*/ @googleapis/cloud-sdk-java-team @googleapis/firestore-team
1616
# Generated code pattern in google-cloud-firestore and google-cloud-firestore-admin
17-
**/*Client.java @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
18-
**/*Settings.java @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
19-
**/*ClientHttpJsonTest.java @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
20-
**/*ClientTest.java @googleapis/cloud-sdk-java-team @googleapis/api-firestore @googleapis/firestore-dpe
17+
**/*Client.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
18+
**/*Settings.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
19+
**/*ClientHttpJsonTest.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
20+
**/*ClientTest.java @googleapis/cloud-sdk-java-team @googleapis/firestore-team
2121

2222
# The java-samples-reviewers team is the default owner for samples changes
2323
samples/**/*.java @googleapis/java-samples-reviewers

.github/sync-repo-settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ permissionRules:
6363
permission: admin
6464
- team: yoshi-java-admins
6565
permission: admin
66-
- team: yoshi-java
66+
- team: cloud-sdk-java-team
6767
permission: push

.repo-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"api_id": "firestore.googleapis.com",
1414
"library_type": "GAPIC_COMBO",
1515
"requires_billing": true,
16-
"codeowner_team": "@googleapis/api-firestore @googleapis/firestore-dpe",
16+
"codeowner_team": "@googleapis/firestore-team",
1717
"excluded_poms": "google-cloud-firestore,google-cloud-firestore-bom",
1818
"issue_tracker": "https://issuetracker.google.com/savedsearches/5337669",
1919
"recommended_package": "com.google.cloud.firestore",

generation_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ libraries:
1212
repo: googleapis/java-firestore
1313
repo_short: java-firestore
1414
distribution_name: com.google.cloud:google-cloud-firestore
15-
codeowner_team: '@googleapis/api-firestore @googleapis/firestore-dpe'
15+
codeowner_team: '@googleapis/firestore-team'
1616
api_id: firestore.googleapis.com
1717
library_type: GAPIC_COMBO
1818
api_description: is a fully-managed NoSQL document database for mobile, web, and server development from Firebase and Google Cloud Platform. It's backed by a multi-region replicated database that ensures once data is committed, it's durable even in the face of unexpected disasters. Not only that, but despite being a distributed database, it's also strongly consistent and offers seamless integration with other Firebase and Google Cloud Platform products, including Google Cloud Functions.

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java

Lines changed: 13 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ public static Field field(FieldPath fieldPath) {
218218
return Field.ofUserPath(fieldPath.toString());
219219
}
220220

221-
222221
/**
223222
* Creates an expression that returns the current timestamp.
224223
*
@@ -229,7 +228,6 @@ public static Expression currentTimestamp() {
229228
return new FunctionExpression("current_timestamp", ImmutableList.of());
230229
}
231230

232-
233231
/**
234232
* Creates an expression that returns a default value if an expression evaluates to an absent
235233
* value.
@@ -4811,8 +4809,7 @@ public static Expression currentDocument() {
48114809
}
48124810

48134811
/**
4814-
* Creates an expression that retrieves the value of a variable bound via {@link
4815-
* Pipeline#define(AliasedExpression, AliasedExpression...)}.
4812+
* Creates an expression that retrieves the value of a variable bound via pipeline definitions.
48164813
*
48174814
* @param name The name of the variable to retrieve.
48184815
* @return An {@link Expression} representing the variable's value.
@@ -4823,97 +4820,33 @@ public static Expression variable(String name) {
48234820
}
48244821

48254822
/**
4826-
* Creates an expression that evaluates to the provided pipeline.
4827-
*
4828-
* @param pipeline The pipeline to use as an expression.
4829-
* @return A new {@link Expression} representing the pipeline value.
4830-
*/
4831-
@InternalApi
4832-
public static Expression pipeline(Pipeline pipeline) {
4833-
return new PipelineValueExpression(pipeline);
4834-
}
4835-
4836-
/**
4837-
* Accesses a field/property of the expression (useful when the expression
4838-
* evaluates to a Map or
4823+
* Accesses a field/property of the expression (useful when the expression evaluates to a Map or
48394824
* Document).
48404825
*
4826+
* @param expression The expression evaluating to a map/document.
48414827
* @param key The key of the field to access.
48424828
* @return An {@link Expression} representing the value of the field.
48434829
*/
48444830
@BetaApi
4845-
public Expression getField(String key) {
4846-
return new FunctionExpression("field", ImmutableList.of(this, constant(key)));
4847-
}
4848-
4849-
/**
4850-
* Retrieves the value of a specific field from the document evaluated by this
4851-
* expression.
4852-
*
4853-
* @param keyExpression The expression evaluating to the key to access.
4854-
* @return A new {@link Expression} representing the field value.
4855-
*/
4856-
@BetaApi
4857-
public Expression getField(Expression keyExpression) {
4858-
return new FunctionExpression("field", ImmutableList.of(this, keyExpression));
4859-
}
4860-
4861-
/**
4862-
* Accesses a field/property of a document field using the provided {@code key}.
4863-
*
4864-
* @param fieldName The field name of the map or document field.
4865-
* @param key The key of the field to access.
4866-
* @return An {@link Expression} representing the value of the field.
4867-
*/
4868-
@BetaApi
4869-
public static Expression getField(String fieldName, String key) {
4870-
return field(fieldName).getField(key);
4871-
}
4872-
4873-
/**
4874-
* Accesses a field/property of the expression using the provided
4875-
* {@code keyExpression}.
4876-
*
4877-
* @param expression The expression evaluating to a Map or Document.
4878-
* @param keyExpression The expression evaluating to the key.
4879-
* @return A new {@link Expression} representing the value of the field.
4880-
*/
4881-
@BetaApi
4882-
public static Expression getField(Expression expression, Expression keyExpression) {
4883-
return expression.getField(keyExpression);
4884-
}
4885-
4886-
/**
4887-
* Accesses a field/property of a document field using the provided
4888-
* {@code keyExpression}.
4889-
*
4890-
* @param fieldName The field name of the map or document field.
4891-
* @param keyExpression The expression evaluating to the key.
4892-
* @return A new {@link Expression} representing the value of the field.
4893-
*/
4894-
@BetaApi
4895-
public static Expression getField(String fieldName, Expression keyExpression) {
4896-
return field(fieldName).getField(keyExpression);
4831+
public static Expression field(Expression expression, String key) {
4832+
return new FunctionExpression("field", ImmutableList.of(expression, constant(key)));
48974833
}
48984834

48994835
/**
4900-
* Accesses a field/property of the expression (useful when the expression
4901-
* evaluates to a Map or Document).
4836+
* Creates an expression that evaluates to the provided pipeline.
49024837
*
4903-
* @param expression The expression evaluating to a map/document.
4904-
* @param key The key of the field to access.
4905-
* @return An {@link Expression} representing the value of the field.
4838+
* @param pipeline The pipeline to use as an expression.
4839+
* @return A new {@link Expression} representing the pipeline value.
49064840
*/
4907-
@BetaApi
4908-
public static Expression getField(Expression expression, String key) {
4909-
return new FunctionExpression("field", ImmutableList.of(expression, constant(key)));
4841+
@InternalApi
4842+
public static Expression pipeline(Pipeline pipeline) {
4843+
return new PipelineValueExpression(pipeline);
49104844
}
49114845

49124846
/**
49134847
* Internal expression representing a variable reference.
49144848
*
4915-
* <p>
4916-
* This evaluates to the value of a variable defined in a pipeline context.
4849+
* <p>This evaluates to the value of a variable defined in a pipeline context.
49174850
*/
49184851
static class Variable extends Expression {
49194852
private final String name;
@@ -4928,9 +4861,7 @@ public Value toProto() {
49284861
}
49294862
}
49304863

4931-
/**
4932-
* Internal expression representing a pipeline value.
4933-
*/
4864+
/** Internal expression representing a pipeline value. */
49344865
static class PipelineValueExpression extends Expression {
49354866
private final Pipeline pipeline;
49364867

@@ -4943,5 +4874,4 @@ public Value toProto() {
49434874
return pipeline.toProtoValue();
49444875
}
49454876
}
4946-
49474877
}

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/DefineStage.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public DefineStage(Map<String, Expression> expressions) {
3939
Iterable<Value> toStageArgs() {
4040
java.util.Map<String, Value> converted = new java.util.HashMap<>();
4141
for (Map.Entry<String, Expression> entry : expressions.entrySet()) {
42-
converted.put(entry.getKey(), com.google.cloud.firestore.pipeline.expressions.FunctionUtils.exprToValue(entry.getValue()));
42+
converted.put(
43+
entry.getKey(),
44+
com.google.cloud.firestore.pipeline.expressions.FunctionUtils.exprToValue(
45+
entry.getValue()));
4346
}
4447
return Collections.singletonList(encodeValue(converted));
4548
}

google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,9 +1947,8 @@ public void arrayContainsAnyQueries() throws Exception {
19471947
if (getFirestoreEdition() == FirestoreEdition.STANDARD) {
19481948
assertEquals(asList("a", "b", "d", "e"), querySnapshotToIds(query.get().get()));
19491949
} else {
1950-
// TODO: Currently rejected because of mixed type setup, backend will change the behavior; and
1951-
// this test will fail by then.
1952-
assertThrows(ExecutionException.class, () -> querySnapshotToIds(query.get().get()));
1950+
assertThat(querySnapshotToIds(query.get().get()))
1951+
.containsExactlyElementsIn(asList("a", "b", "d", "e"));
19531952
}
19541953
}
19551954

0 commit comments

Comments
 (0)