Skip to content
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

Open
wants to merge 93 commits into
base: main
Choose a base branch
from
Open

[feat] ppl #1770

wants to merge 93 commits into from

Conversation

wu-hui
Copy link
Contributor

@wu-hui wu-hui commented Jul 30, 2024

No description provided.

* }</pre>
*/
@BetaApi
public final class Pipeline {
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

* @return A new {@code Expr} representing the addition operation.
*/
@BetaApi
default Add add(Object other) {
Copy link
Contributor

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:

Suggested change
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?

Copy link
Contributor Author

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()));
Copy link
Contributor

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.

@tom-andersen tom-andersen assigned wu-hui and unassigned tom-andersen Aug 14, 2024
wu-hui and others added 9 commits August 21, 2024 12:45
# 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
Copy link
Contributor Author

@wu-hui wu-hui left a 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!

* }</pre>
*/
@BetaApi
public final class Pipeline {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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.

* @return A new {@code Expr} representing the addition operation.
*/
@BetaApi
default Add add(Object other) {
Copy link
Contributor Author

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?

wu-hui and others added 13 commits September 17, 2024 14:41
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/java-firestore API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants