Skip to content

Commit

Permalink
PPL to Console (#8638)
Browse files Browse the repository at this point in the history
* Pipelines for Console Evaluation
  • Loading branch information
MarkDuckworth authored Nov 20, 2024
1 parent e3e2078 commit fafadbc
Show file tree
Hide file tree
Showing 47 changed files with 15,241 additions and 349 deletions.
1,776 changes: 1,737 additions & 39 deletions common/api-review/firestore-lite.api.md

Large diffs are not rendered by default.

1,705 changes: 1,704 additions & 1 deletion common/api-review/firestore.api.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"postinstall-postinstall": "2.1.0",
"prettier": "2.8.7",
"protractor": "5.4.2",
"protobufjs-cli": "^1.1.3",
"request": "2.88.2",
"semver": "7.5.3",
"simple-git": "3.24.0",
Expand Down
165 changes: 165 additions & 0 deletions packages/firestore/lite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,171 @@
import { registerFirestore } from './register';
registerFirestore();

export { PipelineSource } from '../src/lite-api/pipeline-source';

export { PipelineResult } from '../src/lite-api/pipeline-result';

export { Pipeline, pipeline } from '../src/lite-api/pipeline';

export { useFirestorePipelines } from '../src/lite-api/database_augmentation';

export { execute } from '../src/lite-api/pipeline_impl';

export {
Stage,
FindNearestOptions,
AddFields,
Aggregate,
Distinct,
CollectionSource,
CollectionGroupSource,
DatabaseSource,
DocumentsSource,
Where,
FindNearest,
Limit,
Offset,
Select,
Sort,
GenericStage
} from '../src/lite-api/stage';

export {
add,
subtract,
multiply,
divide,
mod,
eq,
neq,
lt,
lte,
gt,
gte,
arrayConcat,
arrayContains,
arrayContainsAny,
arrayContainsAll,
arrayLength,
inAny,
notInAny,
xor,
ifFunction,
not,
logicalMax,
logicalMin,
exists,
isNan,
reverse,
replaceFirst,
replaceAll,
byteLength,
charLength,
like,
regexContains,
regexMatch,
strContains,
startsWith,
endsWith,
toLower,
toUpper,
trim,
strConcat,
mapGet,
countAll,
min,
max,
cosineDistance,
dotProduct,
euclideanDistance,
vectorLength,
unixMicrosToTimestamp,
timestampToUnixMicros,
unixMillisToTimestamp,
timestampToUnixMillis,
unixSecondsToTimestamp,
timestampToUnixSeconds,
timestampAdd,
timestampSub,
genericFunction,
ascending,
descending,
ExprWithAlias,
Field,
Fields,
Constant,
FirestoreFunction,
Add,
Subtract,
Multiply,
Divide,
Mod,
Eq,
Neq,
Lt,
Lte,
Gt,
Gte,
ArrayConcat,
ArrayReverse,
ArrayContains,
ArrayContainsAll,
ArrayContainsAny,
ArrayLength,
ArrayElement,
In,
IsNan,
Exists,
Not,
And,
Or,
Xor,
If,
LogicalMax,
LogicalMin,
Reverse,
ReplaceFirst,
ReplaceAll,
CharLength,
ByteLength,
Like,
RegexContains,
RegexMatch,
StrContains,
StartsWith,
EndsWith,
ToLower,
ToUpper,
Trim,
StrConcat,
MapGet,
Count,
Sum,
Avg,
Min,
Max,
CosineDistance,
DotProduct,
EuclideanDistance,
VectorLength,
UnixMicrosToTimestamp,
TimestampToUnixMicros,
UnixMillisToTimestamp,
TimestampToUnixMillis,
UnixSecondsToTimestamp,
TimestampToUnixSeconds,
TimestampAdd,
TimestampSub,
Ordering,
ExprType,
AccumulatorTarget,
FilterExpr,
SelectableExpr,
Selectable,
FilterCondition,
Accumulator
} from '../src/lite-api/expressions';

export {
aggregateQuerySnapshotEqual,
getCount,
Expand Down
173 changes: 172 additions & 1 deletion packages/firestore/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,176 @@
* limitations under the License.
*/

export { PipelineSource } from './lite-api/pipeline-source';

export { PipelineResult } from './lite-api/pipeline-result';

export { Pipeline, pipeline } from './api/pipeline';

export { useFirestorePipelines } from './api/database_augmentation';

export { execute } from './lite-api/pipeline_impl';

export {
Stage,
FindNearestOptions,
AddFields,
Aggregate,
Distinct,
CollectionSource,
CollectionGroupSource,
DatabaseSource,
DocumentsSource,
Where,
FindNearest,
Limit,
Offset,
Select,
Sort,
GenericStage
} from './lite-api/stage';

export {
add,
subtract,
multiply,
divide,
mod,
eq,
neq,
lt,
lte,
gt,
gte,
arrayConcat,
arrayContains,
arrayContainsAny,
arrayContainsAll,
arrayLength,
inAny,
notInAny,
xor,
ifFunction,
not,
logicalMax,
logicalMin,
exists,
isNan,
reverse,
replaceFirst,
replaceAll,
byteLength,
charLength,
like,
regexContains,
regexMatch,
strContains,
startsWith,
endsWith,
toLower,
toUpper,
trim,
strConcat,
mapGet,
countAll,
countFunction,
sumFunction,
avgFunction,
andFunction,
orFunction,
min,
max,
cosineDistance,
dotProduct,
euclideanDistance,
vectorLength,
unixMicrosToTimestamp,
timestampToUnixMicros,
unixMillisToTimestamp,
timestampToUnixMillis,
unixSecondsToTimestamp,
timestampToUnixSeconds,
timestampAdd,
timestampSub,
genericFunction,
ascending,
descending,
ExprWithAlias,
Field,
Fields,
Constant,
FirestoreFunction,
Add,
Subtract,
Multiply,
Divide,
Mod,
Eq,
Neq,
Lt,
Lte,
Gt,
Gte,
ArrayConcat,
ArrayReverse,
ArrayContains,
ArrayContainsAll,
ArrayContainsAny,
ArrayLength,
ArrayElement,
In,
IsNan,
Exists,
Not,
And,
Or,
Xor,
If,
LogicalMax,
LogicalMin,
Reverse,
ReplaceFirst,
ReplaceAll,
CharLength,
ByteLength,
Like,
RegexContains,
RegexMatch,
StrContains,
StartsWith,
EndsWith,
ToLower,
ToUpper,
Trim,
StrConcat,
MapGet,
Count,
Sum,
Avg,
Min,
Max,
CosineDistance,
DotProduct,
EuclideanDistance,
VectorLength,
UnixMicrosToTimestamp,
TimestampToUnixMicros,
UnixMillisToTimestamp,
TimestampToUnixMillis,
UnixSecondsToTimestamp,
TimestampToUnixSeconds,
TimestampAdd,
TimestampSub,
Ordering,
ExprType,
AccumulatorTarget,
FilterExpr,
SelectableExpr,
Selectable,
FilterCondition,
Accumulator
} from './lite-api/expressions';

export {
aggregateFieldEqual,
aggregateQuerySnapshotEqual,
Expand Down Expand Up @@ -224,7 +394,8 @@ export { isBase64Available as _isBase64Available } from './platform/base64';
export { DatabaseId as _DatabaseId } from './core/database_info';
export {
_internalQueryToProtoQueryTarget,
_internalAggregationQueryToProtoRunAggregationQueryRequest
_internalAggregationQueryToProtoRunAggregationQueryRequest,
_internalPipelineToExecutePipelineRequestProto
} from './remote/internal_serializer';
export {
cast as _cast,
Expand Down
10 changes: 7 additions & 3 deletions packages/firestore/src/api/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@
* limitations under the License.
*/

import { AggregateField, AggregateSpec, DocumentData, Query } from '../api';
import { AggregateImpl } from '../core/aggregate';
import { firestoreClientRunAggregateQuery } from '../core/firestore_client';
import { count } from '../lite-api/aggregate';
import { AggregateQuerySnapshot } from '../lite-api/aggregate_types';
import {
AggregateField,
AggregateQuerySnapshot,
AggregateSpec
} from '../lite-api/aggregate_types';
import { DocumentData, Query } from '../lite-api/reference';
import { ApiClientObjectMap, Value } from '../protos/firestore_proto_api';
import { cast } from '../util/input_validation';
import { mapToArray } from '../util/obj';

import { ensureFirestoreConfigured, Firestore } from './database';
import { ExpUserDataWriter } from './reference_impl';
import { ExpUserDataWriter } from './user_data_writer';

export {
aggregateQuerySnapshotEqual,
Expand Down
Loading

0 comments on commit fafadbc

Please sign in to comment.