feat(firestore): [PQ] create pipeline from query#13339
feat(firestore): [PQ] create pipeline from query#13339bhshkh merged 2 commits intogoogleapis:feature/fs-pipeline-queriesfrom
Conversation
| p = p.Select(fields...) | ||
| } | ||
|
|
||
| // FindNearest |
There was a problem hiding this comment.
I don't remember seeing this in other implementations. Makes sense though. I'll have to look into it more.
How does this interact with other filters? Can we assume a query is either a findNearest query or a standard query? Or do they stack?
There was a problem hiding this comment.
They do indeed stack.
For example, a query like coll.Where("published", ">", 1900).FindNearest(...) would first filter for books published after 1900 and then find the nearest neighbors within that subset.
| p = p.Where(allFilters[0]) | ||
| } else if len(allFilters) > 1 { | ||
| p = p.Where(And(allFilters[0], allFilters[1:]...)) | ||
| } |
There was a problem hiding this comment.
Your implementation seems to differ a bit from java.
- Java does
.where(filters).select(projections).where(orders) - Yours does
where(fitlers and orders).select(projections)
Is this equivalent? (It seems like it might be, but I'm not sure one way or the other)
There was a problem hiding this comment.
While the Go code builds the pipeline in a slightly different order than the Java version, the resulting pipeline is functionally equivalent and will produce the correct results.
|
Will take Go developer review before public preview |
dd603ae
into
googleapis:feature/fs-pipeline-queries
Add CreateFrom() and Pipeline() similar to Java.
https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java#L140-L164
Previous pull requests