Skip to content

Commit 2851bf4

Browse files
committed
port more expressions/stages and integration tests
1 parent 2110f36 commit 2851bf4

File tree

13 files changed

+1781
-263
lines changed

13 files changed

+1781
-263
lines changed

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/PipelineTest.java

Lines changed: 803 additions & 23 deletions
Large diffs are not rendered by default.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/QueryToPipelineTest.java

Lines changed: 49 additions & 52 deletions
Large diffs are not rendered by default.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/testutil/IntegrationTestUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ public static void checkQueryAndPipelineResultsMatch(Query query, String... expe
599599
}
600600
PipelineSnapshot docsFromPipeline;
601601
try {
602-
docsFromPipeline = waitFor(query.getFirestore().pipeline().convertFrom(query).execute());
602+
docsFromPipeline = waitFor(query.getFirestore().pipeline().createFrom(query).execute());
603603
} catch (Exception e) {
604604
throw new RuntimeException("Pipeline FAILED", e);
605605
}

firebase-firestore/src/main/java/com/google/firebase/firestore/AggregateField.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import androidx.annotation.Nullable;
2121
import androidx.annotation.RestrictTo;
2222
import com.google.firebase.firestore.pipeline.AggregateFunction;
23-
import com.google.firebase.firestore.pipeline.AggregateWithAlias;
23+
import com.google.firebase.firestore.pipeline.AliasedAggregate;
2424
import java.util.Objects;
2525

2626
/** Represents an aggregation that can be performed by Firestore. */
@@ -66,7 +66,7 @@ public String getOperator() {
6666
}
6767

6868
@NonNull
69-
abstract AggregateWithAlias toPipeline();
69+
abstract AliasedAggregate toPipeline();
7070

7171
/**
7272
* Returns true if the given object is equal to this object. Two `AggregateField` objects are
@@ -205,7 +205,7 @@ private CountAggregateField() {
205205

206206
@NonNull
207207
@Override
208-
AggregateWithAlias toPipeline() {
208+
AliasedAggregate toPipeline() {
209209
return AggregateFunction.countAll().alias(getAlias());
210210
}
211211
}
@@ -218,7 +218,7 @@ private SumAggregateField(@NonNull FieldPath fieldPath) {
218218

219219
@NonNull
220220
@Override
221-
AggregateWithAlias toPipeline() {
221+
AliasedAggregate toPipeline() {
222222
return field(getFieldPath()).sum().alias(getAlias());
223223
}
224224
}
@@ -231,7 +231,7 @@ private AverageAggregateField(@NonNull FieldPath fieldPath) {
231231

232232
@NonNull
233233
@Override
234-
AggregateWithAlias toPipeline() {
234+
AliasedAggregate toPipeline() {
235235
return field(getFieldPath()).avg().alias(getAlias());
236236
}
237237
}

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,11 @@ static void setClientLanguage(@NonNull String languageToken) {
885885
}
886886

887887
/**
888-
* Build a new Pipeline
888+
* Builds a new Pipeline from this Firestore instance.
889+
*
890+
* NOTE: Pipeline does not have realtime updates support and SDK cache access, it completely relies
891+
* on the connection to the server for the results, and does not augment the results with the SDK
892+
* cache. To get realtime updates and SDK cache access use {@code realTimePipeline()} instead.
889893
*
890894
* @return {@code PipelineSource} for this Firestore instance.
891895
*/
@@ -896,7 +900,13 @@ public PipelineSource pipeline() {
896900
}
897901

898902
/**
899-
* Build a new RealtimePipeline
903+
* Build a new RealtimePipeline from this Firestore instance.
904+
*
905+
* NOTE: RealtimePipeline utilizes the Firestore realtime backend and SDK cache to provide final
906+
* results, this is the equivalent to classic Firestore {@link Query}, but with more features
907+
* supported. However, its feature set is only a subset of {@code Pipeline}. If you need features
908+
* unavailable in {@code RealtimePipeline} and realtime or SDK cache access are not a must, use
909+
* {@code pipeline()} instead.
900910
*
901911
* @return {@code RealtimePipelineSource} for this Firestore instance.
902912
*/

0 commit comments

Comments
 (0)