-
Notifications
You must be signed in to change notification settings - Fork 626
Pipelines Implementation #6710
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
base: feat/pipelines
Are you sure you want to change the base?
Pipelines Implementation #6710
Conversation
Test Results 8 files 8 suites 1m 8s ⏱️ Results for commit ac26746. ♻️ This comment has been updated with latest results. |
The public api surface has changed for the subproject firebase-firestore: The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: The public api surface has changed for the subproject firebase-firestore: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: The public api surface has changed for the subproject firebase-firestore: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-firestore_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
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.
Review is WIP. There is lots of great cleanup in this. Nice work. Only a few comments so far.
@@ -120,6 +120,15 @@ public String getPath() { | |||
return key.getPath().canonicalString(); | |||
} | |||
|
|||
@RestrictTo(RestrictTo.Scope.LIBRARY) | |||
@NonNull | |||
public String getFullPath() { |
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.
Should javadocs for RestrictTo Library indicate that status? Or will this be visible even without use of the linter?
fun replace(field: String): Pipeline = replace(Expr.field(field)) | ||
|
||
/** | ||
* Fully overwrites all fields in a document with those coming from a nested map. |
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 has to be a nested map, it can be any expression that evaluates to a map
unnest(Expr.field(arrayField).alias(alias)) | ||
|
||
/** | ||
* Takes a specified array from the input documents and outputs a document for each element with |
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.
Same, i think this can be any Selectable with an expression that evaluates to an array.
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.
really impressive code. I learned a lot about kotlin. I'm offering a handful of questions and comments.
|
||
companion object { | ||
|
||
@JvmStatic fun generic(name: String, vararg expr: Expr) = AggregateFunction(name, expr) |
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.
should this be raw?
* | ||
* @return A new [AggregateFunction] representing the countAll aggregation. | ||
*/ | ||
@JvmStatic fun countAll() = AggregateFunction("count") |
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.
should the SDK name and server API name match?
@JvmStatic | ||
fun constant(value: Boolean): BooleanExpr { | ||
val encodedValue = encodeValue(value) | ||
return object : BooleanExpr("N/A", emptyArray()) { |
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.
It might be useful to include some documentation covering the reason why you are creating an anonymous BooleanExpr class here
* @return A new [Expr] constant instance representing the Blob. | ||
*/ | ||
@JvmStatic | ||
fun blob(bytes: ByteArray): Expr { |
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.
Possible discussion topic, but it might be more clear to indicate in the function name that this will create a Constant Expr. blobConstant(...)
* @return A [Expr] constant instance. | ||
*/ | ||
@JvmStatic | ||
fun vector(vector: DoubleArray): Expr { |
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.
Same, might be worth naming vectorConstant(...)
or constantVector(...)
|
||
@JvmField val JSON = OutputFormat("json") | ||
|
||
@JvmField val STRUCT = OutputFormat("struct") |
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 haven't seen 'struct' in the spec. Is this different from JSON?
} | ||
} | ||
|
||
class Verbosity private constructor(internal val value: String) { |
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.
same, i haven't seen this in the design. is this new?
} | ||
} | ||
|
||
class Profiles private constructor(internal val value: String) { |
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.
same, i haven't seen this in the design. is this new?
override fun args(userDataReader: UserDataReader): Sequence<Value> = emptySequence() | ||
} | ||
|
||
class CollectionSource |
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.
in node, i found that i liked calling all of these *StageOptions. It gave consistency and meaning across the Pipeline api. Maybe you would consider calling these *Stage.
E.g. CollectionStage or CollectionSourceStage, DatabaseStage, LimitStage, WhereStage, ...
fields.asSequence().map(Field::toProto) | ||
} | ||
|
||
internal class ReplaceStage |
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.
Do you have intent to make all of these internal stages public to support options overrides?
No description provided.