Skip to content

Commit 88dfad8

Browse files
chore: generate libraries at Fri Feb 20 20:58:24 UTC 2026
1 parent ffdcffb commit 88dfad8

2 files changed

Lines changed: 64 additions & 55 deletions

File tree

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,9 +1970,9 @@ public static Expression mapRemove(String mapField, String key) {
19701970
* Creates an expression that returns a new map with the specified entries added or updated.
19711971
*
19721972
* <ul>
1973-
* <li>Only performs shallow updates to the map.</li>
1974-
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove a
1975-
* key entirely, use {@code mapRemove}.</li>
1973+
* <li>Only performs shallow updates to the map.
1974+
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove
1975+
* a key entirely, use {@code mapRemove}.
19761976
* </ul>
19771977
*
19781978
* @param mapExpr The expression representing the map.
@@ -1994,11 +1994,11 @@ public static Expression mapSet(
19941994

19951995
/**
19961996
* Creates an expression that returns a new map with the specified entries added or updated.
1997-
*
1997+
*
19981998
* <ul>
1999-
* <li>Only performs shallow updates to the map.</li>
2000-
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove a
2001-
* key entirely, use {@code mapRemove}.</li>
1999+
* <li>Only performs shallow updates to the map.
2000+
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove
2001+
* a key entirely, use {@code mapRemove}.
20022002
* </ul>
20032003
*
20042004
* @param mapField The map field to set entries in.
@@ -2019,11 +2019,11 @@ public static Expression mapSet(
20192019

20202020
/**
20212021
* Creates an expression that returns a new map with the specified entries added or updated.
2022-
*
2022+
*
20232023
* <ul>
2024-
* <li>Only performs shallow updates to the map.</li>
2025-
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove a
2026-
* key entirely, use {@code mapRemove}.</li>
2024+
* <li>Only performs shallow updates to the map.
2025+
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove
2026+
* a key entirely, use {@code mapRemove}.
20272027
* </ul>
20282028
*
20292029
* @param mapField The map field to set entries in.
@@ -2040,11 +2040,11 @@ public static Expression mapSet(
20402040

20412041
/**
20422042
* Creates an expression that returns a new map with the specified entries added or updated.
2043-
*
2043+
*
20442044
* <ul>
2045-
* <li>Only performs shallow updates to the map.</li>
2046-
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove a
2047-
* key entirely, use {@code mapRemove}.</li>
2045+
* <li>Only performs shallow updates to the map.
2046+
* <li>Setting a value to {@code null} will retain the key with a {@code null} value. To remove
2047+
* a key entirely, use {@code mapRemove}.
20482048
* </ul>
20492049
*
20502050
* @param mapField The map field to set entries in.
@@ -2058,7 +2058,7 @@ public static Expression mapSet(
20582058
String mapField, String key, Object value, Object... moreKeyValues) {
20592059
return mapSet(field(mapField), key, value, moreKeyValues);
20602060
}
2061-
2061+
20622062
/**
20632063
* Creates an expression that returns the keys of a map.
20642064
*
@@ -4614,8 +4614,8 @@ public final Expression mapValues() {
46144614
}
46154615

46164616
/**
4617-
* Creates an expression that returns the entries of this map expression as an array of maps, where
4618-
* each map contains a "k" property for the key and a "v" property for the value.
4617+
* Creates an expression that returns the entries of this map expression as an array of maps,
4618+
* where each map contains a "k" property for the key and a "v" property for the value.
46194619
*
46204620
* <p>While the backend generally preserves insertion order, relying on the order of the output
46214621
* array is not guaranteed and should be avoided.

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

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.google.cloud.firestore.it;
1818

1919
import static com.google.cloud.firestore.FieldValue.vector;
20-
import static com.google.cloud.firestore.LocalFirestoreHelper.query;
2120
import static com.google.cloud.firestore.it.ITQueryTest.map;
2221
import static com.google.cloud.firestore.it.TestHelper.isRunningAgainstFirestoreEmulator;
2322
import static com.google.cloud.firestore.pipeline.expressions.AggregateFunction.count;
@@ -51,12 +50,8 @@
5150
import static com.google.cloud.firestore.pipeline.expressions.Expression.log;
5251
import static com.google.cloud.firestore.pipeline.expressions.Expression.logicalMaximum;
5352
import static com.google.cloud.firestore.pipeline.expressions.Expression.logicalMinimum;
54-
import static com.google.cloud.firestore.pipeline.expressions.Expression.mapEntries;
55-
import static com.google.cloud.firestore.pipeline.expressions.Expression.mapKeys;
5653
import static com.google.cloud.firestore.pipeline.expressions.Expression.mapMerge;
5754
import static com.google.cloud.firestore.pipeline.expressions.Expression.mapRemove;
58-
import static com.google.cloud.firestore.pipeline.expressions.Expression.mapSet;
59-
import static com.google.cloud.firestore.pipeline.expressions.Expression.mapValues;
6055
import static com.google.cloud.firestore.pipeline.expressions.Expression.notEqual;
6156
import static com.google.cloud.firestore.pipeline.expressions.Expression.nullValue;
6257
import static com.google.cloud.firestore.pipeline.expressions.Expression.or;
@@ -86,7 +81,6 @@
8681
import com.google.cloud.Timestamp;
8782
import com.google.cloud.firestore.Blob;
8883
import com.google.cloud.firestore.CollectionReference;
89-
import com.google.cloud.firestore.DocumentReference;
9084
import com.google.cloud.firestore.Firestore;
9185
import com.google.cloud.firestore.FirestoreOptions;
9286
import com.google.cloud.firestore.GeoPoint;
@@ -112,7 +106,6 @@
112106
import com.google.common.collect.ImmutableList;
113107
import com.google.common.collect.ImmutableMap;
114108
import com.google.common.collect.Lists;
115-
import java.util.Arrays;
116109
import java.util.Date;
117110
import java.util.HashMap;
118111
import java.util.List;
@@ -1384,7 +1377,8 @@ public void testMapGet() throws Exception {
13841377
map("hugoAward", true, "title", "The Hitchhiker's Guide to the Galaxy"),
13851378
map("hugoAward", true, "title", "Dune")));
13861379
}
1387-
@Test
1380+
1381+
@Test
13881382
public void testMapSet() throws Exception {
13891383
Map<String, Object> docData = new HashMap<>();
13901384
docData.put("existingField", ImmutableMap.of("foo", 1L));
@@ -1400,18 +1394,30 @@ public void testMapSet() throws Exception {
14001394
Expression.mapSet(constant(ImmutableMap.of()), "a", 1).as("simple"),
14011395
Expression.mapSet(constant(ImmutableMap.of("a", 1)), "b", 2).as("add"),
14021396
Expression.mapSet(constant(ImmutableMap.of("a", 1)), "a", 2).as("overwrite"),
1403-
Expression.mapSet(constant(ImmutableMap.of("a", 1, "b", 2)), "a", 3, "c", 4).as("multi"),
1404-
Expression.mapSet(constant(ImmutableMap.of("a", 1)), "a", field("non_existent")).as("remove"),
1397+
Expression.mapSet(constant(ImmutableMap.of("a", 1, "b", 2)), "a", 3, "c", 4)
1398+
.as("multi"),
1399+
Expression.mapSet(constant(ImmutableMap.of("a", 1)), "a", field("non_existent"))
1400+
.as("remove"),
14051401
Expression.mapSet(constant(ImmutableMap.of("a", 1)), "b", null).as("setNull"),
1406-
Expression.mapSet(constant(ImmutableMap.of("a", ImmutableMap.of("b", 1))), "a.b", 2).as("setDotted"),
1402+
Expression.mapSet(constant(ImmutableMap.of("a", ImmutableMap.of("b", 1))), "a.b", 2)
1403+
.as("setDotted"),
14071404
Expression.mapSet(constant(ImmutableMap.of()), "", "empty").as("setEmptyKey"),
1408-
Expression.mapSet(constant(ImmutableMap.of("a", 1)), "b", Expression.add(constant(1), constant(2))).as("setExprVal"),
1409-
Expression.mapSet(constant(ImmutableMap.of()), "obj", constant(ImmutableMap.of("hidden", true))).as("setNestedMap"),
1410-
Expression.mapSet(constant(ImmutableMap.of()), "~!@#$%^&*()_+", "special").as("setSpecialChars"),
1411-
1405+
Expression.mapSet(
1406+
constant(ImmutableMap.of("a", 1)),
1407+
"b",
1408+
Expression.add(constant(1), constant(2)))
1409+
.as("setExprVal"),
1410+
Expression.mapSet(
1411+
constant(ImmutableMap.of()),
1412+
"obj",
1413+
constant(ImmutableMap.of("hidden", true)))
1414+
.as("setNestedMap"),
1415+
Expression.mapSet(constant(ImmutableMap.of()), "~!@#$%^&*()_+", "special")
1416+
.as("setSpecialChars"),
14121417
field("existingField").mapSet("instanceKey", 100).as("instanceSetField"),
1413-
constant(ImmutableMap.of("x", 1)).mapSet(constant("y"), constant(2)).as("instanceSetConstant")
1414-
)
1418+
constant(ImmutableMap.of("x", 1))
1419+
.mapSet(constant("y"), constant(2))
1420+
.as("instanceSetConstant"))
14151421
.execute()
14161422
.get();
14171423

@@ -1426,17 +1432,19 @@ public void testMapSet() throws Exception {
14261432
assertThat((Map<?, ?>) data.get("multi")).containsExactly("a", 3L, "b", 2L, "c", 4L);
14271433
assertThat((Map<?, ?>) data.get("remove")).isEmpty();
14281434
assertThat((Map<?, ?>) data.get("setNull")).containsExactly("a", 1L, "b", null);
1429-
1435+
14301436
Map<?, ?> setDotted = (Map<?, ?>) data.get("setDotted");
14311437
assertThat(setDotted).containsEntry("a.b", 2L);
14321438
assertThat((Map<?, ?>) setDotted.get("a")).containsExactly("b", 1L);
14331439

14341440
assertThat((Map<?, ?>) data.get("setEmptyKey")).containsExactly("", "empty");
14351441
assertThat((Map<?, ?>) data.get("setExprVal")).containsExactly("a", 1L, "b", 3L);
1436-
assertThat((Map<?, ?>) data.get("setNestedMap")).isEqualTo(ImmutableMap.of("obj", ImmutableMap.of("hidden", true)));
1442+
assertThat((Map<?, ?>) data.get("setNestedMap"))
1443+
.isEqualTo(ImmutableMap.of("obj", ImmutableMap.of("hidden", true)));
14371444
assertThat((Map<?, ?>) data.get("setSpecialChars")).containsExactly("~!@#$%^&*()_+", "special");
14381445

1439-
assertThat((Map<?, ?>) data.get("instanceSetField")).containsExactly("foo", 1L, "instanceKey", 100L);
1446+
assertThat((Map<?, ?>) data.get("instanceSetField"))
1447+
.containsExactly("foo", 1L, "instanceKey", 100L);
14401448
assertThat((Map<?, ?>) data.get("instanceSetConstant")).containsExactly("x", 1L, "y", 2L);
14411449
}
14421450

@@ -1455,11 +1463,10 @@ public void testMapKeys() throws Exception {
14551463
Expression.mapKeys("existingField").as("existingKeys"),
14561464
Expression.mapKeys(constant(ImmutableMap.of("a", 1, "b", 2))).as("keys"),
14571465
Expression.mapKeys(constant(ImmutableMap.of())).as("empty_keys"),
1458-
Expression.mapKeys(constant(ImmutableMap.of("a", ImmutableMap.of("nested", true)))).as("nested_keys"),
1459-
1466+
Expression.mapKeys(constant(ImmutableMap.of("a", ImmutableMap.of("nested", true))))
1467+
.as("nested_keys"),
14601468
field("existingField").mapKeys().as("instanceExistingKeys"),
1461-
constant(ImmutableMap.of("x", 10, "y", 20)).mapKeys().as("instanceKeys")
1462-
)
1469+
constant(ImmutableMap.of("x", 10, "y", 20)).mapKeys().as("instanceKeys"))
14631470
.execute()
14641471
.get();
14651472

@@ -1468,7 +1475,7 @@ public void testMapKeys() throws Exception {
14681475
Map<String, Object> data = resultList.get(0).getData();
14691476

14701477
assertThat((List<?>) data.get("existingKeys")).containsExactly("foo");
1471-
assertThat((List<?>) data.get("keys")).containsExactly("a", "b");
1478+
assertThat((List<?>) data.get("keys")).containsExactly("a", "b");
14721479
assertThat((List<?>) data.get("empty_keys")).isEmpty();
14731480
assertThat((List<?>) data.get("nested_keys")).containsExactly("a");
14741481

@@ -1491,11 +1498,11 @@ public void testMapValues() throws Exception {
14911498
Expression.mapValues("existingField").as("existingValues"),
14921499
Expression.mapValues(constant(ImmutableMap.of("a", 1, "b", 2))).as("values"),
14931500
Expression.mapValues(constant(ImmutableMap.of())).as("empty_values"),
1494-
Expression.mapValues(constant(ImmutableMap.of("a", ImmutableMap.of("nested", true)))).as("nested_values"),
1495-
1501+
Expression.mapValues(
1502+
constant(ImmutableMap.of("a", ImmutableMap.of("nested", true))))
1503+
.as("nested_values"),
14961504
field("existingField").mapValues().as("instanceExistingValues"),
1497-
constant(ImmutableMap.of("x", 10, "y", 20)).mapValues().as("instanceValues")
1498-
)
1505+
constant(ImmutableMap.of("x", 10, "y", 20)).mapValues().as("instanceValues"))
14991506
.execute()
15001507
.get();
15011508

@@ -1506,7 +1513,8 @@ public void testMapValues() throws Exception {
15061513
assertThat((List<?>) data.get("existingValues")).containsExactly(1L);
15071514
assertThat((List<?>) data.get("values")).containsExactly(1L, 2L);
15081515
assertThat((List<?>) data.get("empty_values")).isEmpty();
1509-
assertThat((List<?>) data.get("nested_values")).containsExactly(ImmutableMap.of("nested", true));
1516+
assertThat((List<?>) data.get("nested_values"))
1517+
.containsExactly(ImmutableMap.of("nested", true));
15101518

15111519
assertThat((List<?>) data.get("instanceExistingValues")).containsExactly(1L);
15121520
assertThat((List<?>) data.get("instanceValues")).containsExactly(10L, 20L);
@@ -1527,11 +1535,11 @@ public void testMapEntries() throws Exception {
15271535
Expression.mapEntries("existingField").as("existingEntries"),
15281536
Expression.mapEntries(constant(ImmutableMap.of("a", 1, "b", 2))).as("entries"),
15291537
Expression.mapEntries(constant(ImmutableMap.of())).as("empty_entries"),
1530-
Expression.mapEntries(constant(ImmutableMap.of("a", ImmutableMap.of("nested", true)))).as("nested_entries"),
1531-
1538+
Expression.mapEntries(
1539+
constant(ImmutableMap.of("a", ImmutableMap.of("nested", true))))
1540+
.as("nested_entries"),
15321541
field("existingField").mapEntries().as("instanceExistingEntries"),
1533-
constant(ImmutableMap.of("x", 10, "y", 20)).mapEntries().as("instanceEntries")
1534-
)
1542+
constant(ImmutableMap.of("x", 10, "y", 20)).mapEntries().as("instanceEntries"))
15351543
.execute()
15361544
.get();
15371545

@@ -1545,7 +1553,7 @@ public void testMapEntries() throws Exception {
15451553
@SuppressWarnings("unchecked")
15461554
List<Map<String, Object>> entries = (List<Map<String, Object>>) data.get("entries");
15471555
assertThat(entries).hasSize(2);
1548-
1556+
15491557
// Map entry order is not guaranteed, so we check containment instead of strict ordering
15501558
assertThat(entries).contains(ImmutableMap.of("k", "a", "v", 1L));
15511559
assertThat(entries).contains(ImmutableMap.of("k", "b", "v", 2L));
@@ -1558,11 +1566,13 @@ public void testMapEntries() throws Exception {
15581566
.containsExactly(ImmutableMap.of("k", "foo", "v", 1L));
15591567

15601568
@SuppressWarnings("unchecked")
1561-
List<Map<String, Object>> instanceEntries = (List<Map<String, Object>>) data.get("instanceEntries");
1569+
List<Map<String, Object>> instanceEntries =
1570+
(List<Map<String, Object>>) data.get("instanceEntries");
15621571
assertThat(instanceEntries).hasSize(2);
15631572
assertThat(instanceEntries).contains(ImmutableMap.of("k", "x", "v", 10L));
15641573
assertThat(instanceEntries).contains(ImmutableMap.of("k", "y", "v", 20L));
15651574
}
1575+
15661576
@Test
15671577
public void testDataManipulationExpressions() throws Exception {
15681578
List<PipelineResult> results =
@@ -2933,5 +2943,4 @@ public void disallowDuplicateAliasesAcrossStages() {
29332943
});
29342944
assertThat(exception).hasMessageThat().contains("Duplicate alias or field name");
29352945
}
2936-
29372946
}

0 commit comments

Comments
 (0)