-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] ppl #1770
base: main
Are you sure you want to change the base?
[feat] ppl #1770
Conversation
setup nix for idx
…uandy/PipelineResult
pipeline result
google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java
Outdated
Show resolved
Hide resolved
* }</pre> | ||
*/ | ||
@BetaApi | ||
public final class Pipeline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this class can be simplified. Here is a suggestion: #1786
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that PR looks very helpful.
} | ||
if (response.getResultsCount() > 0) { | ||
numDocuments += response.getResultsCount(); | ||
if (numDocuments % 100 == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition seems wrong.
Maybe you should output trace when numDocuments > 100
, and then reset numDocuments
?
The trace message could add return numDocuments
value instead of 100
.
Also, text still says Firestore.Query
and should be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, copy/paste from query does not work for pipeline here.
google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Stage.java
Show resolved
Hide resolved
* @return A new {@code Expr} representing the addition operation. | ||
*/ | ||
@BetaApi | ||
default Add add(Object other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ambiguous types in overloads cause problems. The danger is that an Expr
is cast to Object
causing wrong method to be called.
You could add:
default Add add(Object other) { | |
default Add add(Object other) { | |
if (other instanceof Expr) { | |
return add((Expr) other); | |
} |
But can we instead come up with an API surface that doesn't require inspection of type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a problem. Constant.of should take care of the type inspection?
@BetaApi | ||
public static Constant ofVector(double[] value) { | ||
// Convert double array to List<Double> | ||
return new Constant(Arrays.stream(value).boxed().collect(Collectors.toList())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull from main and use Marks work on VectorValues.
...-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Constant.java
Outdated
Show resolved
Hide resolved
...-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Function.java
Outdated
Show resolved
Hide resolved
# Conflicts: # README.md # google-cloud-firestore/pom.xml # google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateQuery.java # google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java # proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentProto.java
…vaPplPP # Conflicts: # README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions!
google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java
Outdated
Show resolved
Hide resolved
* }</pre> | ||
*/ | ||
@BetaApi | ||
public final class Pipeline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that PR looks very helpful.
} | ||
if (response.getResultsCount() > 0) { | ||
numDocuments += response.getResultsCount(); | ||
if (numDocuments % 100 == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, copy/paste from query does not work for pipeline here.
...-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Constant.java
Outdated
Show resolved
Hide resolved
* @return A new {@code Expr} representing the addition operation. | ||
*/ | ||
@BetaApi | ||
default Add add(Object other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a problem. Constant.of should take care of the type inspection?
...-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Function.java
Outdated
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Stage.java
Show resolved
Hide resolved
# Conflicts: # google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java
* Implement new stages. * Replace toList() with older languages feature. * Pretty * Pretty * Comment out under development API surface * Pretty
* Refactor pipelines * Pretty * Simplify
No description provided.