@azure/cosmos 4.7.0-alpha.20251118.1 → 4.8.0-alpha.20251120.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/CosmosClientOptions.d.ts +1 -1
- package/dist/browser/CosmosClientOptions.js.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js +2 -34
- package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js +2 -35
- package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/changeFeedUtils.js +47 -0
- package/dist/browser/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/browser/common/constants.d.ts.map +1 -1
- package/dist/browser/common/constants.js +16 -1
- package/dist/browser/common/constants.js.map +1 -1
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.js +84 -0
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.js +39 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.js +4 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/browser/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/browser/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/browser/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/browser/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +174 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +28 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +129 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +66 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.js +23 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.js +55 -0
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.js +156 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.js +105 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.js +93 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.js +65 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/browser/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/documentProducer.js +17 -4
- package/dist/browser/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/index.d.ts +7 -0
- package/dist/browser/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/index.js +4 -0
- package/dist/browser/queryExecutionContext/index.js.map +1 -1
- package/dist/browser/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/browser/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/browser/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/browser/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/orderByComparator.js +20 -3
- package/dist/browser/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/browser/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/parallelQueryResult.js +23 -0
- package/dist/browser/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +4 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +310 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +102 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +180 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +93 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +4 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +53 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +34 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +4 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.js +4 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/browser/queryIterator.js.map +1 -1
- package/dist/browser/utils/offers.d.ts.map +1 -1
- package/dist/browser/utils/offers.js +0 -1
- package/dist/browser/utils/offers.js.map +1 -1
- package/dist/commonjs/CosmosClientOptions.d.ts +1 -1
- package/dist/commonjs/CosmosClientOptions.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js +1 -33
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js +1 -34
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js +48 -0
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/commonjs/common/constants.d.ts.map +1 -1
- package/dist/commonjs/common/constants.js +13 -2
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.js +93 -0
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.js +44 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.js +5 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/commonjs/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/commonjs/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/commonjs/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/commonjs/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +178 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +31 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +133 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +70 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.js +26 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.js +59 -0
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.js +160 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.js +109 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.js +97 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.js +69 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/commonjs/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/documentProducer.js +17 -4
- package/dist/commonjs/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/index.d.ts +7 -0
- package/dist/commonjs/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/index.js +10 -0
- package/dist/commonjs/queryExecutionContext/index.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/commonjs/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByComparator.js +21 -3
- package/dist/commonjs/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.js +26 -0
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +314 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +106 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +184 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +97 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +57 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +38 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/commonjs/queryIterator.js.map +1 -1
- package/dist/commonjs/utils/offers.d.ts.map +1 -1
- package/dist/commonjs/utils/offers.js +0 -1
- package/dist/commonjs/utils/offers.js.map +1 -1
- package/dist/esm/CosmosClientOptions.d.ts +1 -1
- package/dist/esm/CosmosClientOptions.js.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js +2 -34
- package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js +2 -35
- package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/changeFeedUtils.js +47 -0
- package/dist/esm/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +16 -1
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.js +84 -0
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.js +39 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.js +4 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/esm/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/esm/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/esm/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/esm/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +174 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +28 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +129 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +66 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.js +23 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.js +55 -0
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.js +156 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.js +105 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.js +93 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.js +65 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/esm/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/documentProducer.js +17 -4
- package/dist/esm/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/index.d.ts +7 -0
- package/dist/esm/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/index.js +4 -0
- package/dist/esm/queryExecutionContext/index.js.map +1 -1
- package/dist/esm/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/esm/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/esm/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/esm/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/orderByComparator.js +20 -3
- package/dist/esm/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/esm/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/parallelQueryResult.js +23 -0
- package/dist/esm/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +4 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +310 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +102 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +180 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +93 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +4 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +53 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +34 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +4 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.js +4 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/esm/queryIterator.js.map +1 -1
- package/dist/esm/utils/offers.d.ts.map +1 -1
- package/dist/esm/utils/offers.js +0 -1
- package/dist/esm/utils/offers.js.map +1 -1
- package/dist/react-native/CosmosClientOptions.d.ts +1 -1
- package/dist/react-native/CosmosClientOptions.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js +2 -34
- package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js +2 -35
- package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.js +47 -0
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/react-native/common/constants.d.ts.map +1 -1
- package/dist/react-native/common/constants.js +16 -1
- package/dist/react-native/common/constants.js.map +1 -1
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.js +84 -0
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.js +39 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.js +4 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/react-native/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/react-native/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/react-native/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/react-native/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +174 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +28 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +129 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +66 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.js +23 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.js +55 -0
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.js +156 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.js +105 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.js +93 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.js +65 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/react-native/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/documentProducer.js +17 -4
- package/dist/react-native/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/index.d.ts +7 -0
- package/dist/react-native/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/index.js +4 -0
- package/dist/react-native/queryExecutionContext/index.js.map +1 -1
- package/dist/react-native/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/react-native/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/react-native/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByComparator.js +20 -3
- package/dist/react-native/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/react-native/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/parallelQueryResult.js +23 -0
- package/dist/react-native/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +4 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +310 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +102 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +180 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +93 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +4 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +53 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +34 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +4 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.js +4 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/react-native/queryIterator.js.map +1 -1
- package/dist/react-native/utils/offers.d.ts.map +1 -1
- package/dist/react-native/utils/offers.js +0 -1
- package/dist/react-native/utils/offers.js.map +1 -1
- package/package.json +6 -5
|
@@ -3,6 +3,7 @@ import { hashObject } from "../../utils/hashObject.js";
|
|
|
3
3
|
import { FixedSizePriorityQueue } from "../../utils/fixedSizePriorityQueue.js";
|
|
4
4
|
import { NonStreamingOrderByMap } from "../../utils/nonStreamingOrderByMap.js";
|
|
5
5
|
import { OrderByComparator } from "../orderByComparator.js";
|
|
6
|
+
import { createParallelQueryResult } from "../parallelQueryResult.js";
|
|
6
7
|
/**
|
|
7
8
|
* @hidden
|
|
8
9
|
* Represents an endpoint in handling an non-streaming order by distinct query.
|
|
@@ -96,19 +97,36 @@ export class NonStreamingOrderByDistinctEndpointComponent {
|
|
|
96
97
|
if (this.executionContext.hasMoreResults()) {
|
|
97
98
|
// Grab the next result
|
|
98
99
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
99
|
-
if (response
|
|
100
|
+
if (!response) {
|
|
100
101
|
this.isCompleted = true;
|
|
101
102
|
if (this.aggregateMap.size() > 0) {
|
|
102
103
|
await this.buildFinalResultArray();
|
|
104
|
+
const result = createParallelQueryResult(this.finalResultArray, new Map(), {}, undefined);
|
|
103
105
|
return {
|
|
104
|
-
result
|
|
106
|
+
result,
|
|
107
|
+
headers: resHeaders,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return { result: undefined, headers: resHeaders };
|
|
111
|
+
}
|
|
112
|
+
if (response.result === undefined ||
|
|
113
|
+
!Array.isArray(response.result.buffer) ||
|
|
114
|
+
response.result.buffer.length === 0) {
|
|
115
|
+
this.isCompleted = true;
|
|
116
|
+
if (this.aggregateMap.size() > 0) {
|
|
117
|
+
await this.buildFinalResultArray();
|
|
118
|
+
const result = createParallelQueryResult(this.finalResultArray, new Map(), {}, undefined);
|
|
119
|
+
return {
|
|
120
|
+
result,
|
|
105
121
|
headers: response.headers,
|
|
106
122
|
};
|
|
107
123
|
}
|
|
108
124
|
return { result: undefined, headers: response.headers };
|
|
109
125
|
}
|
|
110
126
|
resHeaders = response.headers;
|
|
111
|
-
|
|
127
|
+
const parallelResult = response.result;
|
|
128
|
+
const dataToProcess = parallelResult.buffer;
|
|
129
|
+
for (const item of dataToProcess) {
|
|
112
130
|
if (item) {
|
|
113
131
|
const key = await hashObject(item?.payload);
|
|
114
132
|
this.aggregateMap.set(key, item);
|
|
@@ -116,8 +134,10 @@ export class NonStreamingOrderByDistinctEndpointComponent {
|
|
|
116
134
|
}
|
|
117
135
|
// return [] to signal that there are more results to fetch.
|
|
118
136
|
if (this.executionContext.hasMoreResults()) {
|
|
137
|
+
const result = createParallelQueryResult([], // empty buffer
|
|
138
|
+
new Map(), undefined, undefined);
|
|
119
139
|
return {
|
|
120
|
-
result
|
|
140
|
+
result,
|
|
121
141
|
headers: resHeaders,
|
|
122
142
|
};
|
|
123
143
|
}
|
|
@@ -126,14 +146,16 @@ export class NonStreamingOrderByDistinctEndpointComponent {
|
|
|
126
146
|
if (!this.executionContext.hasMoreResults() && !this.isCompleted) {
|
|
127
147
|
this.isCompleted = true;
|
|
128
148
|
await this.buildFinalResultArray();
|
|
149
|
+
const result = createParallelQueryResult(this.finalResultArray, new Map());
|
|
129
150
|
return {
|
|
130
|
-
result
|
|
151
|
+
result,
|
|
131
152
|
headers: resHeaders,
|
|
132
153
|
};
|
|
133
154
|
}
|
|
134
155
|
// Signal that there are no more results.
|
|
156
|
+
const result = createParallelQueryResult([], new Map());
|
|
135
157
|
return {
|
|
136
|
-
result
|
|
158
|
+
result,
|
|
137
159
|
headers: resHeaders,
|
|
138
160
|
};
|
|
139
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByDistinctEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;GAGG;AACH,MAAM,OAAO,4CAA4C;IAqB7C;IACA;IACA;IACA;IAv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ED,iEAAiE;QACjE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC;YACnC,OAAO;gBACL,MAAM,EAAE,IAAI,CAAC,gBAAgB;gBAC7B,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;QACD,yCAAyC;QACzC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,UAAU;SACpB,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { QueryInfo, Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport { NonStreamingOrderByMap } from \"../../utils/nonStreamingOrderByMap.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by distinct query.\n */\nexport class NonStreamingOrderByDistinctEndpointComponent implements ExecutionContext {\n /**\n * A Map that holds the distinct values of the items before storing in priority queue.\n */\n private aggregateMap: NonStreamingOrderByMap<NonStreamingOrderByResult>;\n /**\n * A priority queue to compute the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Array to store the final sorted results.\n */\n private finalResultArray: NonStreamingOrderByResult[];\n\n private sortOrders: string[];\n /**\n * Flag to determine if all results are fetched from backend and results can be returned.\n */\n private isCompleted: boolean = false;\n\n constructor(\n private executionContext: ExecutionContext,\n private queryInfo: QueryInfo,\n private priorityQueueBufferSize: number,\n private emitRawOrderByPayload: boolean = false,\n ) {\n this.sortOrders = this.queryInfo.orderBy;\n const comparator = new OrderByComparator(this.sortOrders);\n this.aggregateMap = new NonStreamingOrderByMap<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(a, b);\n },\n );\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Build final sorted result array from which responses will be served.\n */\n private async buildFinalResultArray(): Promise<void> {\n // Fetch all distinct values from the map and store in priority queue.\n const allValues = this.aggregateMap.getAllValuesAndReset();\n for (const value of allValues) {\n this.nonStreamingOrderByPQ.enqueue(value);\n }\n\n // Compute the final result array size based on offset and limit.\n const offSet = this.queryInfo.offset ? this.queryInfo.offset : 0;\n const queueSize = this.nonStreamingOrderByPQ.size();\n const finalArraySize = queueSize - offSet;\n\n if (finalArraySize <= 0) {\n this.finalResultArray = [];\n } else {\n this.finalResultArray = new Array(finalArraySize);\n // Only keep the final result array size number of items in the final result array and discard the rest.\n for (let count = finalArraySize - 1; count >= 0; count--) {\n if (this.emitRawOrderByPayload) {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue();\n } else {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue()?.payload;\n }\n }\n }\n }\n\n public hasMoreResults(): boolean {\n if (this.priorityQueueBufferSize === 0) return false;\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n\n // If there are more results in backend, keep filling map.\n if (this.executionContext.hasMoreResults()) {\n // Grab the next result\n const response = await this.executionContext.fetchMore(diagnosticNode);\n if (response === undefined || response.result === undefined) {\n this.isCompleted = true;\n if (this.aggregateMap.size() > 0) {\n await this.buildFinalResultArray();\n return {\n result: this.finalResultArray,\n headers: response.headers,\n };\n }\n return { result: undefined, headers: response.headers };\n }\n resHeaders = response.headers;\n for (const item of response.result) {\n if (item) {\n const key = await hashObject(item?.payload);\n this.aggregateMap.set(key, item);\n }\n }\n\n // return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n return {\n result: [],\n headers: resHeaders,\n };\n }\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n await this.buildFinalResultArray();\n return {\n result: this.finalResultArray,\n headers: resHeaders,\n };\n }\n // Signal that there are no more results.\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByDistinctEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;GAGG;AACH,MAAM,OAAO,4CAA4C;IAqB7C;IACA;IACA;IACA;IAvBV;;OAEG;IACK,YAAY,CAAoD;IACxE;;OAEG;IACK,qBAAqB,CAAoD;IAC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EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAExD,OAAO;YACL,MAAM;YACN,OAAO,EAAE,UAAU;SACpB,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { QueryInfo, Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport { NonStreamingOrderByMap } from \"../../utils/nonStreamingOrderByMap.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by distinct query.\n */\nexport class NonStreamingOrderByDistinctEndpointComponent implements ExecutionContext {\n /**\n * A Map that holds the distinct values of the items before storing in priority queue.\n */\n private aggregateMap: NonStreamingOrderByMap<NonStreamingOrderByResult>;\n /**\n * A priority queue to compute the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Array to store the final sorted results.\n */\n private finalResultArray: NonStreamingOrderByResult[];\n\n private sortOrders: string[];\n /**\n * Flag to determine if all results are fetched from backend and results can be returned.\n */\n private isCompleted: boolean = false;\n\n constructor(\n private executionContext: ExecutionContext,\n private queryInfo: QueryInfo,\n private priorityQueueBufferSize: number,\n private emitRawOrderByPayload: boolean = false,\n ) {\n this.sortOrders = this.queryInfo.orderBy;\n const comparator = new OrderByComparator(this.sortOrders);\n this.aggregateMap = new NonStreamingOrderByMap<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(a, b);\n },\n );\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Build final sorted result array from which responses will be served.\n */\n private async buildFinalResultArray(): Promise<void> {\n // Fetch all distinct values from the map and store in priority queue.\n const allValues = this.aggregateMap.getAllValuesAndReset();\n for (const value of allValues) {\n this.nonStreamingOrderByPQ.enqueue(value);\n }\n\n // Compute the final result array size based on offset and limit.\n const offSet = this.queryInfo.offset ? this.queryInfo.offset : 0;\n const queueSize = this.nonStreamingOrderByPQ.size();\n const finalArraySize = queueSize - offSet;\n\n if (finalArraySize <= 0) {\n this.finalResultArray = [];\n } else {\n this.finalResultArray = new Array(finalArraySize);\n // Only keep the final result array size number of items in the final result array and discard the rest.\n for (let count = finalArraySize - 1; count >= 0; count--) {\n if (this.emitRawOrderByPayload) {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue();\n } else {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue()?.payload;\n }\n }\n }\n }\n\n public hasMoreResults(): boolean {\n if (this.priorityQueueBufferSize === 0) return false;\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n\n // If there are more results in backend, keep filling map.\n if (this.executionContext.hasMoreResults()) {\n // Grab the next result\n const response = await this.executionContext.fetchMore(diagnosticNode);\n\n if (!response) {\n this.isCompleted = true;\n if (this.aggregateMap.size() > 0) {\n await this.buildFinalResultArray();\n const result = createParallelQueryResult(this.finalResultArray, new Map(), {}, undefined);\n\n return {\n result,\n headers: resHeaders,\n };\n }\n return { result: undefined, headers: resHeaders };\n }\n\n if (\n response.result === undefined ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n this.isCompleted = true;\n if (this.aggregateMap.size() > 0) {\n await this.buildFinalResultArray();\n const result = createParallelQueryResult(this.finalResultArray, new Map(), {}, undefined);\n\n return {\n result,\n headers: response.headers,\n };\n }\n return { result: undefined, headers: response.headers };\n }\n resHeaders = response.headers;\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: NonStreamingOrderByResult[] =\n parallelResult.buffer as NonStreamingOrderByResult[];\n\n for (const item of dataToProcess) {\n if (item) {\n const key = await hashObject(item?.payload);\n this.aggregateMap.set(key, item);\n }\n }\n\n // return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n const result = createParallelQueryResult(\n [], // empty buffer\n new Map(),\n undefined,\n undefined,\n );\n\n return {\n result,\n headers: resHeaders,\n };\n }\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n await this.buildFinalResultArray();\n const result = createParallelQueryResult(this.finalResultArray, new Map());\n\n return {\n result,\n headers: resHeaders,\n };\n }\n // Signal that there are no more results.\n const result = createParallelQueryResult([], new Map());\n\n return {\n result,\n headers: resHeaders,\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D;;;GAGG;AACH,qBAAa,oCAAqC,YAAW,gBAAgB;IAiBzE,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,uBAAuB;IAC/B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,qBAAqB;IApB/B;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAoD;IACjF;;OAEG;IACH,OAAO,CAAC,WAAW,CAAkB;IACrC;;;;;;OAMG;gBAEO,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,GAAG,EAAE,EACjB,uBAAuB,EAAE,MAAM,EAC/B,MAAM,GAAE,MAAU,EAClB,qBAAqB,GAAE,OAAe;IAWhD;;;OAGG;IACI,cAAc,IAAI,OAAO;IAIhC;;;OAGG;IACU,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAiFzE,qBAAqB;CA6CpC"}
|
package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OrderByComparator } from "../orderByComparator.js";
|
|
2
2
|
import { FixedSizePriorityQueue } from "../../utils/fixedSizePriorityQueue.js";
|
|
3
3
|
import { getInitialHeader } from "../headerUtils.js";
|
|
4
|
+
import { createParallelQueryResult } from "../parallelQueryResult.js";
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
6
7
|
* Represents an endpoint in handling an non-streaming order by query.
|
|
@@ -66,15 +67,26 @@ export class NonStreamingOrderByEndpointComponent {
|
|
|
66
67
|
// If there are more results in backend, keep filling pq.
|
|
67
68
|
if (this.executionContext.hasMoreResults()) {
|
|
68
69
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
70
|
+
if (!response) {
|
|
71
|
+
this.isCompleted = true;
|
|
72
|
+
if (!this.nonStreamingOrderByPQ.isEmpty()) {
|
|
73
|
+
return this.buildFinalResultArray(resHeaders);
|
|
74
|
+
}
|
|
75
|
+
return { result: undefined, headers: resHeaders };
|
|
76
|
+
}
|
|
69
77
|
resHeaders = response.headers;
|
|
70
|
-
if (response
|
|
78
|
+
if (response.result === undefined ||
|
|
79
|
+
!response.result.buffer ||
|
|
80
|
+
response.result.buffer.length === 0) {
|
|
71
81
|
this.isCompleted = true;
|
|
72
82
|
if (!this.nonStreamingOrderByPQ.isEmpty()) {
|
|
73
83
|
return this.buildFinalResultArray(resHeaders);
|
|
74
84
|
}
|
|
75
85
|
return { result: undefined, headers: resHeaders };
|
|
76
86
|
}
|
|
77
|
-
|
|
87
|
+
const parallelResult = response.result;
|
|
88
|
+
const dataToProcess = parallelResult.buffer;
|
|
89
|
+
for (const item of dataToProcess) {
|
|
78
90
|
if (item !== undefined) {
|
|
79
91
|
this.nonStreamingOrderByPQ.enqueue(item);
|
|
80
92
|
}
|
|
@@ -82,23 +94,26 @@ export class NonStreamingOrderByEndpointComponent {
|
|
|
82
94
|
}
|
|
83
95
|
// If the backend has more results to fetch, return [] to signal that there are more results to fetch.
|
|
84
96
|
if (this.executionContext.hasMoreResults()) {
|
|
97
|
+
const result = createParallelQueryResult([], // empty buffer
|
|
98
|
+
new Map(), {});
|
|
85
99
|
return {
|
|
86
|
-
result
|
|
100
|
+
result,
|
|
87
101
|
headers: resHeaders,
|
|
88
102
|
};
|
|
89
103
|
}
|
|
90
104
|
// If all results are fetched from backend, prepare final results
|
|
91
105
|
if (!this.executionContext.hasMoreResults() && !this.isCompleted) {
|
|
92
106
|
this.isCompleted = true;
|
|
93
|
-
return this.buildFinalResultArray(resHeaders);
|
|
107
|
+
return this.buildFinalResultArray(resHeaders, new Map(), {});
|
|
94
108
|
}
|
|
95
109
|
// If pq is empty, return undefined to signal that there are no more results.
|
|
110
|
+
const result = createParallelQueryResult([], new Map(), {});
|
|
96
111
|
return {
|
|
97
|
-
result
|
|
112
|
+
result,
|
|
98
113
|
headers: resHeaders,
|
|
99
114
|
};
|
|
100
115
|
}
|
|
101
|
-
async buildFinalResultArray(resHeaders) {
|
|
116
|
+
async buildFinalResultArray(resHeaders, partitionKeyRangeMap, updatedContinuationRanges) {
|
|
102
117
|
// Set isCompleted to true.
|
|
103
118
|
this.isCompleted = true;
|
|
104
119
|
// Reverse the priority queue to get the results in the correct order
|
|
@@ -124,8 +139,9 @@ export class NonStreamingOrderByEndpointComponent {
|
|
|
124
139
|
buffer.push(this.nonStreamingOrderByPQ.dequeue()?.payload);
|
|
125
140
|
}
|
|
126
141
|
}
|
|
142
|
+
const result = createParallelQueryResult(buffer, partitionKeyRangeMap || new Map(), updatedContinuationRanges || {}, undefined);
|
|
127
143
|
return {
|
|
128
|
-
result
|
|
144
|
+
result,
|
|
129
145
|
headers: resHeaders,
|
|
130
146
|
};
|
|
131
147
|
}
|
package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,oCAAoC;IAiBrC;IACA;IACA;IACA;IACA;IAp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A2B;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,qEAAqE;QACrE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;QAClE,4EAA4E;QAC5E,8DAA8D;QAC9D,OACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,uBAAuB;YAC1C,IAAI,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EACrC,CAAC;YACD,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;QAED,iDAAiD;QACjD,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAU,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC/B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport type { CosmosHeaders } from \"../headerUtils.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by query.\n */\nexport class NonStreamingOrderByEndpointComponent implements ExecutionContext {\n /**\n * A priority queue to store the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Flag to determine if all results are fetched from backend and results can be returned from priority queue.\n */\n private isCompleted: boolean = false;\n /**\n * Represents an endpoint in handling an non-streaming order by query. For each processed orderby\n * result it returns 'payload' item of the result\n *\n * @param executionContext - Underlying Execution Context\n * @hidden\n */\n constructor(\n private executionContext: ExecutionContext,\n private sortOrders: any[],\n private priorityQueueBufferSize: number,\n private offset: number = 0,\n private emitRawOrderByPayload: boolean = false,\n ) {\n const comparator = new OrderByComparator(this.sortOrders);\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Determine if there are still remaining resources to processs.\n * @returns true if there is other elements to process in the NonStreamingOrderByEndpointComponent.\n */\n public hasMoreResults(): boolean {\n return this.priorityQueueBufferSize > 0 && this.executionContext.hasMoreResults();\n }\n\n /**\n * Fetches the next batch of the result from the target container.\n * @param diagnosticNode - The diagnostic information for the request.\n */\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n // If there are more results in backend, keep filling pq.\n if (this.executionContext.hasMoreResults()) {\n const response = await this.executionContext.fetchMore(diagnosticNode);\n resHeaders = response.headers;\n if (response === undefined || response.result === undefined) {\n this.isCompleted = true;\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n return this.buildFinalResultArray(resHeaders);\n }\n return { result: undefined, headers: resHeaders };\n }\n\n for (const item of response.result) {\n if (item !== undefined) {\n this.nonStreamingOrderByPQ.enqueue(item);\n }\n }\n }\n\n // If the backend has more results to fetch, return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n return {\n result: [],\n headers: resHeaders,\n };\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n return this.buildFinalResultArray(resHeaders);\n }\n\n // If pq is empty, return undefined to signal that there are no more results.\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n\n private async buildFinalResultArray(resHeaders: CosmosHeaders): Promise<Response<any>> {\n // Set isCompleted to true.\n this.isCompleted = true;\n // Reverse the priority queue to get the results in the correct order\n this.nonStreamingOrderByPQ = this.nonStreamingOrderByPQ.reverse();\n // For offset limit case we set the size of priority queue to offset + limit\n // and we drain offset number of items from the priority queue\n while (\n this.offset < this.priorityQueueBufferSize &&\n this.offset > 0 &&\n !this.nonStreamingOrderByPQ.isEmpty()\n ) {\n this.nonStreamingOrderByPQ.dequeue();\n this.offset--;\n }\n\n // If pq is not empty, return the result from pq.\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n const buffer: any[] = [];\n if (this.emitRawOrderByPayload) {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue());\n }\n } else {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue()?.payload);\n }\n }\n return {\n result: buffer,\n headers: resHeaders,\n };\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;GAGG;AACH,MAAM,OAAO,oCAAoC;IAiBrC;IACA;IACA;IACA;IACA;IApBV;;OAEG;IACK,qBAAqB,CAAoD;IACjF;;OAEG;IACK,WAAW,GAAY,KAAK,CAAC;IACrC;;;;;;OAMG;IACH,YACU,gBAAkC,EAClC,UAAiB,EACjB,uBAA+B,EAC/B,SAAiB,CAAC,EAClB,wBAAiC,KAAK;QAJtC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,eAAU,GAAV,UAAU,CAAO;QACjB,4BAAuB,GAAvB,uBAAuB,CAAQ;QAC/B,WAAM,GAAN,MAAM,CAAY;QAClB,0BAAqB,GAArB,qBAAqB,CAAiB;QAE9C,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,IAAI,CAAC,qBAAqB,GAAG,IAAI,sBAAsB,CACrD,CAAC,CAA4B,EAAE,CAA4B,EAAE,EAAE;YAC7D,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC,EACD,IAAI,CAAC,uBAAuB,CAC7B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,uBAAuB,GAAG,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IACpF,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,SAAS,CAAC,cAAuC;Q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C,OAAO,EAAE,CAAC;QAClE,4EAA4E;QAC5E,8DAA8D;QAC9D,OACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,uBAAuB;YAC1C,IAAI,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EACrC,CAAC;YACD,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;QAED,iDAAiD;QACjD,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAU,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC/B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,MAAM,MAAM,GAAG,yBAAyB,CACtC,MAAM,EACN,oBAAoB,IAAI,IAAI,GAAG,EAAE,EACjC,yBAAyB,IAAI,EAAE,EAC/B,SAAS,CACV,CAAC;YAEF,OAAO;gBACL,MAAM;gBACN,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport type { CosmosHeaders } from \"../headerUtils.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\nimport type { QueryRangeMapping } from \"../queryRangeMapping.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by query.\n */\nexport class NonStreamingOrderByEndpointComponent implements ExecutionContext {\n /**\n * A priority queue to store the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Flag to determine if all results are fetched from backend and results can be returned from priority queue.\n */\n private isCompleted: boolean = false;\n /**\n * Represents an endpoint in handling an non-streaming order by query. For each processed orderby\n * result it returns 'payload' item of the result\n *\n * @param executionContext - Underlying Execution Context\n * @hidden\n */\n constructor(\n private executionContext: ExecutionContext,\n private sortOrders: any[],\n private priorityQueueBufferSize: number,\n private offset: number = 0,\n private emitRawOrderByPayload: boolean = false,\n ) {\n const comparator = new OrderByComparator(this.sortOrders);\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Determine if there are still remaining resources to processs.\n * @returns true if there is other elements to process in the NonStreamingOrderByEndpointComponent.\n */\n public hasMoreResults(): boolean {\n return this.priorityQueueBufferSize > 0 && this.executionContext.hasMoreResults();\n }\n\n /**\n * Fetches the next batch of the result from the target container.\n * @param diagnosticNode - The diagnostic information for the request.\n */\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n // If there are more results in backend, keep filling pq.\n if (this.executionContext.hasMoreResults()) {\n const response = await this.executionContext.fetchMore(diagnosticNode);\n\n if (!response) {\n this.isCompleted = true;\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n return this.buildFinalResultArray(resHeaders);\n }\n return { result: undefined, headers: resHeaders };\n }\n\n resHeaders = response.headers;\n if (\n response.result === undefined ||\n !response.result.buffer ||\n response.result.buffer.length === 0\n ) {\n this.isCompleted = true;\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n return this.buildFinalResultArray(resHeaders);\n }\n return { result: undefined, headers: resHeaders };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: NonStreamingOrderByResult[] =\n parallelResult.buffer as NonStreamingOrderByResult[];\n\n for (const item of dataToProcess) {\n if (item !== undefined) {\n this.nonStreamingOrderByPQ.enqueue(item);\n }\n }\n }\n\n // If the backend has more results to fetch, return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n const result = createParallelQueryResult(\n [], // empty buffer\n new Map(),\n {},\n );\n\n return {\n result,\n headers: resHeaders,\n };\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n return this.buildFinalResultArray(resHeaders, new Map(), {});\n }\n\n // If pq is empty, return undefined to signal that there are no more results.\n const result = createParallelQueryResult([], new Map(), {});\n\n return {\n result,\n headers: resHeaders,\n };\n }\n\n private async buildFinalResultArray(\n resHeaders: CosmosHeaders,\n partitionKeyRangeMap?: Map<string, QueryRangeMapping>,\n updatedContinuationRanges?: Record<string, any>,\n ): Promise<Response<any>> {\n // Set isCompleted to true.\n this.isCompleted = true;\n // Reverse the priority queue to get the results in the correct order\n this.nonStreamingOrderByPQ = this.nonStreamingOrderByPQ.reverse();\n // For offset limit case we set the size of priority queue to offset + limit\n // and we drain offset number of items from the priority queue\n while (\n this.offset < this.priorityQueueBufferSize &&\n this.offset > 0 &&\n !this.nonStreamingOrderByPQ.isEmpty()\n ) {\n this.nonStreamingOrderByPQ.dequeue();\n this.offset--;\n }\n\n // If pq is not empty, return the result from pq.\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n const buffer: any[] = [];\n if (this.emitRawOrderByPayload) {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue());\n }\n } else {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue()?.payload);\n }\n }\n const result = createParallelQueryResult(\n buffer,\n partitionKeyRangeMap || new Map(),\n updatedContinuationRanges || {},\n undefined,\n );\n\n return {\n result,\n headers: resHeaders,\n };\n }\n }\n}\n"]}
|
package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffsetLimitEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"OffsetLimitEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,cAAc;AACd,qBAAa,4BAA6B,YAAW,gBAAgB;IAEjE,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,KAAK;gBAFL,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM;IAGhB,cAAc,IAAI,OAAO;IAInB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAiExF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getInitialHeader, mergeHeaders } from "../headerUtils.js";
|
|
2
|
+
import { createParallelQueryResult } from "../parallelQueryResult.js";
|
|
3
|
+
import { calculateOffsetLimitForPartitionRanges } from "../PartitionRangeUtils.js";
|
|
2
4
|
/** @hidden */
|
|
3
5
|
export class OffsetLimitEndpointComponent {
|
|
4
6
|
executionContext;
|
|
@@ -16,20 +18,49 @@ export class OffsetLimitEndpointComponent {
|
|
|
16
18
|
const aggregateHeaders = getInitialHeader();
|
|
17
19
|
const buffer = [];
|
|
18
20
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
21
|
+
if (!response) {
|
|
22
|
+
return { result: undefined, headers: aggregateHeaders };
|
|
23
|
+
}
|
|
19
24
|
mergeHeaders(aggregateHeaders, response.headers);
|
|
20
|
-
if (response
|
|
21
|
-
|
|
25
|
+
if (response.result === undefined ||
|
|
26
|
+
!Array.isArray(response.result.buffer) ||
|
|
27
|
+
response.result.buffer.length === 0) {
|
|
28
|
+
return { result: response.result, headers: response.headers };
|
|
22
29
|
}
|
|
23
|
-
|
|
30
|
+
const parallelResult = response.result;
|
|
31
|
+
const dataToProcess = parallelResult.buffer;
|
|
32
|
+
const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;
|
|
33
|
+
const updatedContinuationRanges = parallelResult.updatedContinuationRanges;
|
|
34
|
+
const orderByItems = parallelResult.orderByItems;
|
|
35
|
+
const initialOffset = this.offset;
|
|
36
|
+
const initialLimit = this.limit;
|
|
37
|
+
const filteredOrderByItems = [];
|
|
38
|
+
let itemIndex = 0;
|
|
39
|
+
for (const item of dataToProcess) {
|
|
24
40
|
if (this.offset > 0) {
|
|
25
41
|
this.offset--;
|
|
42
|
+
// Skip this item AND its corresponding orderByItems entry
|
|
26
43
|
}
|
|
27
44
|
else if (this.limit > 0) {
|
|
28
45
|
buffer.push(item);
|
|
46
|
+
// Include the corresponding orderByItems entry
|
|
47
|
+
if (orderByItems && itemIndex < orderByItems.length) {
|
|
48
|
+
filteredOrderByItems.push(orderByItems[itemIndex]);
|
|
49
|
+
}
|
|
29
50
|
this.limit--;
|
|
30
51
|
}
|
|
52
|
+
itemIndex++;
|
|
31
53
|
}
|
|
32
|
-
|
|
54
|
+
// Process offset/limit logic and update partition key range map
|
|
55
|
+
// Note: Pass initial offset/limit values (not current state) to calculateOffsetLimitForPartitionRanges
|
|
56
|
+
// This function updates partition metadata while the loop above processes actual data items
|
|
57
|
+
const updatedPartitionKeyRangeMap = calculateOffsetLimitForPartitionRanges(partitionKeyRangeMap, initialOffset, initialLimit);
|
|
58
|
+
// Return in the new structure format using the utility function
|
|
59
|
+
const result = createParallelQueryResult(buffer, updatedPartitionKeyRangeMap, updatedContinuationRanges, filteredOrderByItems.length > 0 ? filteredOrderByItems : undefined);
|
|
60
|
+
return {
|
|
61
|
+
result,
|
|
62
|
+
headers: aggregateHeaders,
|
|
63
|
+
};
|
|
33
64
|
}
|
|
34
65
|
}
|
|
35
66
|
//# sourceMappingURL=OffsetLimitEndpointComponent.js.map
|
package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffsetLimitEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,cAAc;AACd,MAAM,OAAO,4BAA4B;IAE7B;IACA;IACA;IAHV,YACU,gBAAkC,EAClC,MAAc,EACd,KAAa;QAFb,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAQ;IACpB,CAAC;IAEG,cAAc;QACnB,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IACvF,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,cAAuC;QAC5D,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACvE,YAAY,CAAC,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,
|
|
1
|
+
{"version":3,"file":"OffsetLimitEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,sCAAsC,EAAE,MAAM,2BAA2B,CAAC;AAEnF,cAAc;AACd,MAAM,OAAO,4BAA4B;IAE7B;IACA;IACA;IAHV,YACU,gBAAkC,EAClC,MAAc,EACd,KAAa;QAFb,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAQ;IACpB,CAAC;IAEG,cAAc;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E,CAAC;QACvC,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,0DAA0D;YAC5D,CAAC;iBAAM,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,+CAA+C;gBAC/C,IAAI,YAAY,IAAI,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;oBACpD,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrD,CAAC;gBACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC;YACD,SAAS,EAAE,CAAC;QACd,CAAC;QAED,gEAAgE;QAChE,uGAAuG;QACvG,4FAA4F;QAC5F,MAAM,2BAA2B,GAAG,sCAAsC,CACxE,oBAAoB,EACpB,aAAa,EACb,YAAY,CACb,CAAC;QAEF,gEAAgE;QAChE,MAAM,MAAM,GAAG,yBAAyB,CACtC,MAAM,EACN,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CACnE,CAAC;QAEF,OAAO;YACL,MAAM;YACN,OAAO,EAAE,gBAAgB;SAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { getInitialHeader, mergeHeaders } from \"../headerUtils.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { calculateOffsetLimitForPartitionRanges } from \"../PartitionRangeUtils.js\";\n\n/** @hidden */\nexport class OffsetLimitEndpointComponent implements ExecutionContext {\n constructor(\n private executionContext: ExecutionContext,\n private offset: number,\n private limit: number,\n ) {}\n\n public hasMoreResults(): boolean {\n return (this.offset > 0 || this.limit > 0) && this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n const aggregateHeaders = getInitialHeader();\n const buffer: any[] = [];\n const response = await this.executionContext.fetchMore(diagnosticNode);\n if (!response) {\n return { result: undefined, headers: aggregateHeaders };\n }\n mergeHeaders(aggregateHeaders, response.headers);\n if (\n response.result === undefined ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n return { result: response.result, headers: response.headers };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: any[] = parallelResult.buffer;\n const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;\n const updatedContinuationRanges = parallelResult.updatedContinuationRanges;\n const orderByItems = parallelResult.orderByItems;\n\n const initialOffset = this.offset;\n const initialLimit = this.limit;\n\n const filteredOrderByItems: any[] = [];\n let itemIndex = 0;\n\n for (const item of dataToProcess) {\n if (this.offset > 0) {\n this.offset--;\n // Skip this item AND its corresponding orderByItems entry\n } else if (this.limit > 0) {\n buffer.push(item);\n // Include the corresponding orderByItems entry\n if (orderByItems && itemIndex < orderByItems.length) {\n filteredOrderByItems.push(orderByItems[itemIndex]);\n }\n this.limit--;\n }\n itemIndex++;\n }\n\n // Process offset/limit logic and update partition key range map\n // Note: Pass initial offset/limit values (not current state) to calculateOffsetLimitForPartitionRanges\n // This function updates partition metadata while the loop above processes actual data items\n const updatedPartitionKeyRangeMap = calculateOffsetLimitForPartitionRanges(\n partitionKeyRangeMap,\n initialOffset,\n initialLimit,\n );\n\n // Return in the new structure format using the utility function\n const result = createParallelQueryResult(\n buffer,\n updatedPartitionKeyRangeMap,\n updatedContinuationRanges,\n filteredOrderByItems.length > 0 ? filteredOrderByItems : undefined,\n );\n\n return {\n result,\n headers: aggregateHeaders,\n };\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export declare class OrderByEndpointComponent implements ExecutionContext {
|
|
|
10
10
|
* result it returns 'payload' item of the result
|
|
11
11
|
*
|
|
12
12
|
* @param executionContext - Underlying Execution Context
|
|
13
|
+
* @param emitRawOrderByPayload - Whether to emit raw order by payload
|
|
13
14
|
* @hidden
|
|
14
15
|
*/
|
|
15
16
|
constructor(executionContext: ExecutionContext, emitRawOrderByPayload?: boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"OrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,cAAc;AACd,qBAAa,wBAAyB,YAAW,gBAAgB;IAU7D,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,qBAAqB;IAV/B;;;;;;;OAOG;gBAEO,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,GAAE,OAAe;IAEhD;;;OAGG;IACI,cAAc,IAAI,OAAO;IAInB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAgDxF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createParallelQueryResult } from "../parallelQueryResult.js";
|
|
1
2
|
/** @hidden */
|
|
2
3
|
export class OrderByEndpointComponent {
|
|
3
4
|
executionContext;
|
|
@@ -7,6 +8,7 @@ export class OrderByEndpointComponent {
|
|
|
7
8
|
* result it returns 'payload' item of the result
|
|
8
9
|
*
|
|
9
10
|
* @param executionContext - Underlying Execution Context
|
|
11
|
+
* @param emitRawOrderByPayload - Whether to emit raw order by payload
|
|
10
12
|
* @hidden
|
|
11
13
|
*/
|
|
12
14
|
constructor(executionContext, emitRawOrderByPayload = false) {
|
|
@@ -22,19 +24,35 @@ export class OrderByEndpointComponent {
|
|
|
22
24
|
}
|
|
23
25
|
async fetchMore(diagnosticNode) {
|
|
24
26
|
const buffer = [];
|
|
27
|
+
const orderByItemsArray = []; // Store order by items for each item
|
|
25
28
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
26
|
-
if (response
|
|
27
|
-
|
|
29
|
+
if (!response ||
|
|
30
|
+
!response.result ||
|
|
31
|
+
!Array.isArray(response.result.buffer) ||
|
|
32
|
+
response.result.buffer.length === 0) {
|
|
33
|
+
// Preserve the partitionKeyRangeMap and updatedContinuationRanges from the original response
|
|
34
|
+
// even when the buffer is empty, as they contain continuation token information
|
|
35
|
+
const originalResult = response?.result;
|
|
36
|
+
const result = createParallelQueryResult([], originalResult?.partitionKeyRangeMap || new Map(), originalResult?.updatedContinuationRanges || {}, []);
|
|
37
|
+
return { result, headers: response?.headers };
|
|
28
38
|
}
|
|
29
|
-
|
|
39
|
+
const parallelResult = response.result;
|
|
40
|
+
const rawBuffer = parallelResult.buffer;
|
|
41
|
+
const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;
|
|
42
|
+
const updatedContinuationRanges = parallelResult.updatedContinuationRanges;
|
|
43
|
+
// Process buffer items and collect order by items for each item
|
|
44
|
+
for (let i = 0; i < rawBuffer.length; i++) {
|
|
45
|
+
const item = rawBuffer[i];
|
|
30
46
|
if (this.emitRawOrderByPayload) {
|
|
31
47
|
buffer.push(item);
|
|
32
48
|
}
|
|
33
49
|
else {
|
|
34
50
|
buffer.push(item.payload);
|
|
35
51
|
}
|
|
52
|
+
orderByItemsArray.push({ orderByItems: item.orderByItems, _rid: item._rid });
|
|
36
53
|
}
|
|
37
|
-
|
|
54
|
+
const result = createParallelQueryResult(buffer, partitionKeyRangeMap, updatedContinuationRanges, orderByItemsArray);
|
|
55
|
+
return { result, headers: response.headers };
|
|
38
56
|
}
|
|
39
57
|
}
|
|
40
58
|
//# sourceMappingURL=OrderByEndpointComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.ts"],"names":[],"mappings":"AAMA,cAAc;AACd,MAAM,OAAO,wBAAwB;
|
|
1
|
+
{"version":3,"file":"OrderByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc;AACd,MAAM,OAAO,wBAAwB;IAUzB;IACA;IAVV;;;;;;;OAOG;IACH,YACU,gBAAkC,EAClC,wBAAiC,KAAK;QADtC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,0BAAqB,GAArB,qBAAqB,CAAiB;IAC7C,CAAC;IACJ;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,cAAuC;QAC5D,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,iBAAiB,GAAyB,EAAE,CAAC,CAAC,qCAAqC;QAEzF,M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AAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,MAAM,GAAG,yBAAyB,CACtC,MAAM,EACN,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,CAClB,CAAC;QAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\nimport type { OrderByItemWithRid } from \"../parallelQueryResult.js\";\n\n/** @hidden */\nexport class OrderByEndpointComponent implements ExecutionContext {\n /**\n * Represents an endpoint in handling an order by query. For each processed orderby\n * result it returns 'payload' item of the result\n *\n * @param executionContext - Underlying Execution Context\n * @param emitRawOrderByPayload - Whether to emit raw order by payload\n * @hidden\n */\n constructor(\n private executionContext: ExecutionContext,\n private emitRawOrderByPayload: boolean = false,\n ) {}\n /**\n * Determine if there are still remaining resources to processs.\n * @returns true if there is other elements to process in the OrderByEndpointComponent.\n */\n public hasMoreResults(): boolean {\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n const buffer: any[] = [];\n const orderByItemsArray: OrderByItemWithRid[] = []; // Store order by items for each item\n\n const response = await this.executionContext.fetchMore(diagnosticNode);\n if (\n !response ||\n !response.result ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n // Preserve the partitionKeyRangeMap and updatedContinuationRanges from the original response\n // even when the buffer is empty, as they contain continuation token information\n const originalResult = response?.result as ParallelQueryResult;\n const result = createParallelQueryResult(\n [],\n originalResult?.partitionKeyRangeMap || new Map(),\n originalResult?.updatedContinuationRanges || {},\n [],\n );\n return { result, headers: response?.headers };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const rawBuffer = parallelResult.buffer;\n const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;\n const updatedContinuationRanges = parallelResult.updatedContinuationRanges;\n\n // Process buffer items and collect order by items for each item\n for (let i = 0; i < rawBuffer.length; i++) {\n const item = rawBuffer[i];\n if (this.emitRawOrderByPayload) {\n buffer.push(item);\n } else {\n buffer.push(item.payload);\n }\n orderByItemsArray.push({ orderByItems: item.orderByItems, _rid: item._rid });\n }\n\n const result = createParallelQueryResult(\n buffer,\n partitionKeyRangeMap,\n updatedContinuationRanges,\n orderByItemsArray,\n );\n\n return { result, headers: response.headers };\n }\n}\n"]}
|
package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { DiagnosticNodeInternal } from "../../diagnostics/DiagnosticNodeInt
|
|
|
5
5
|
export declare class OrderedDistinctEndpointComponent implements ExecutionContext {
|
|
6
6
|
private executionContext;
|
|
7
7
|
private hashedLastResult;
|
|
8
|
-
constructor(executionContext: ExecutionContext);
|
|
8
|
+
constructor(executionContext: ExecutionContext, hashedLastResult?: string);
|
|
9
9
|
hasMoreResults(): boolean;
|
|
10
10
|
fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>>;
|
|
11
11
|
}
|
package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderedDistinctEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"OrderedDistinctEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAI1F,cAAc;AACd,qBAAa,gCAAiC,YAAW,gBAAgB;IAIrE,OAAO,CAAC,gBAAgB;IAH1B,OAAO,CAAC,gBAAgB,CAAS;gBAGvB,gBAAgB,EAAE,gBAAgB,EAC1C,gBAAgB,CAAC,EAAE,MAAM;IAKpB,cAAc,IAAI,OAAO;IAInB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAiDxF"}
|
package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { hashObject } from "../../utils/hashObject.js";
|
|
2
|
+
import { createParallelQueryResult } from "../parallelQueryResult.js";
|
|
3
|
+
import { processDistinctQueryAndUpdateRangeMap } from "../PartitionRangeUtils.js";
|
|
2
4
|
/** @hidden */
|
|
3
5
|
export class OrderedDistinctEndpointComponent {
|
|
4
6
|
executionContext;
|
|
5
7
|
hashedLastResult;
|
|
6
|
-
constructor(executionContext) {
|
|
8
|
+
constructor(executionContext, hashedLastResult) {
|
|
7
9
|
this.executionContext = executionContext;
|
|
10
|
+
this.hashedLastResult = hashedLastResult;
|
|
8
11
|
}
|
|
9
12
|
hasMoreResults() {
|
|
10
13
|
return this.executionContext.hasMoreResults();
|
|
@@ -12,10 +15,19 @@ export class OrderedDistinctEndpointComponent {
|
|
|
12
15
|
async fetchMore(diagnosticNode) {
|
|
13
16
|
const buffer = [];
|
|
14
17
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
15
|
-
if (response
|
|
16
|
-
|
|
18
|
+
if (!response ||
|
|
19
|
+
!response.result ||
|
|
20
|
+
!Array.isArray(response.result.buffer) ||
|
|
21
|
+
response.result.buffer.length === 0) {
|
|
22
|
+
return { result: response.result, headers: response.headers };
|
|
17
23
|
}
|
|
18
|
-
|
|
24
|
+
const parallelResult = response.result;
|
|
25
|
+
const dataToProcess = parallelResult.buffer;
|
|
26
|
+
const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;
|
|
27
|
+
const updatedContinuationRanges = parallelResult.updatedContinuationRanges;
|
|
28
|
+
const orderByItems = parallelResult.orderByItems;
|
|
29
|
+
// Process each item and maintain hashedLastResult for distinct filtering
|
|
30
|
+
for (const item of dataToProcess) {
|
|
19
31
|
if (item) {
|
|
20
32
|
const hashedResult = await hashObject(item);
|
|
21
33
|
if (hashedResult !== this.hashedLastResult) {
|
|
@@ -24,7 +36,14 @@ export class OrderedDistinctEndpointComponent {
|
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
|
-
|
|
39
|
+
// Process distinct query logic and update partition key range map with hashedLastResult
|
|
40
|
+
const updatedPartitionKeyRangeMap = await processDistinctQueryAndUpdateRangeMap(dataToProcess, partitionKeyRangeMap, hashObject);
|
|
41
|
+
// Return in the new structure format using the utility function
|
|
42
|
+
const result = createParallelQueryResult(buffer, updatedPartitionKeyRangeMap, updatedContinuationRanges, orderByItems);
|
|
43
|
+
return {
|
|
44
|
+
result,
|
|
45
|
+
headers: response.headers,
|
|
46
|
+
};
|
|
28
47
|
}
|
|
29
48
|
}
|
|
30
49
|
//# sourceMappingURL=OrderedDistinctEndpointComponent.js.map
|
package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderedDistinctEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"OrderedDistinctEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,yBAAyB,EAA4B,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAElF,cAAc;AACd,MAAM,OAAO,gCAAgC;IAIjC;IAHF,gBAAgB,CAAS;IAEjC,YACU,gBAAkC,EAC1C,gBAAyB;QADjB,qBAAgB,GAAhB,gBAAgB,CAAkB;QAG1C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,cAAuC;QAC5D,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACvE,IACE,CAAC,QAAQ;YACT,CAAC,QAAQ,CAAC,MAAM;YAChB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;YACtC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EACnC,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;QAChE,CAAC;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,MAA6B,CAAC;QAC9D,MAAM,aAAa,GAAU,cAAc,CAAC,MAAM,CAAC;QACnD,MAAM,oBAAoB,GAAG,cAAc,CAAC,oBAAoB,CAAC;QACjE,MAAM,yBAAyB,GAAG,cAAc,CAAC,yBAAyB,CAAC;QAC3E,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC;QAEjD,yEAAyE;QACzE,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC5C,IAAI,YAAY,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBAC3C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAClB,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC;gBACvC,CAAC;YACH,CAAC;QACH,CAAC;QAED,wFAAwF;QACxF,MAAM,2BAA2B,GAAG,MAAM,qCAAqC,CAC7E,aAAa,EACb,oBAAoB,EACpB,UAAU,CACX,CAAC;QAEF,gEAAgE;QAChE,MAAM,MAAM,GAAG,yBAAyB,CACtC,MAAM,EACN,2BAA2B,EAC3B,yBAAyB,EACzB,YAAY,CACb,CAAC;QAEF,OAAO;YACL,MAAM;YACN,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport { createParallelQueryResult, type ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { processDistinctQueryAndUpdateRangeMap } from \"../PartitionRangeUtils.js\";\n\n/** @hidden */\nexport class OrderedDistinctEndpointComponent implements ExecutionContext {\n private hashedLastResult: string;\n\n constructor(\n private executionContext: ExecutionContext,\n hashedLastResult?: string,\n ) {\n this.hashedLastResult = hashedLastResult;\n }\n\n public hasMoreResults(): boolean {\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n const buffer: any[] = [];\n const response = await this.executionContext.fetchMore(diagnosticNode);\n if (\n !response ||\n !response.result ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n return { result: response.result, headers: response.headers };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: any[] = parallelResult.buffer;\n const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;\n const updatedContinuationRanges = parallelResult.updatedContinuationRanges;\n const orderByItems = parallelResult.orderByItems;\n\n // Process each item and maintain hashedLastResult for distinct filtering\n for (const item of dataToProcess) {\n if (item) {\n const hashedResult = await hashObject(item);\n if (hashedResult !== this.hashedLastResult) {\n buffer.push(item);\n this.hashedLastResult = hashedResult;\n }\n }\n }\n\n // Process distinct query logic and update partition key range map with hashedLastResult\n const updatedPartitionKeyRangeMap = await processDistinctQueryAndUpdateRangeMap(\n dataToProcess,\n partitionKeyRangeMap,\n hashObject,\n );\n\n // Return in the new structure format using the utility function\n const result = createParallelQueryResult(\n buffer,\n updatedPartitionKeyRangeMap,\n updatedContinuationRanges,\n orderByItems,\n );\n\n return {\n result,\n headers: response.headers,\n };\n }\n}\n"]}
|
package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnorderedDistinctEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"UnorderedDistinctEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAK1F,cAAc;AACd,qBAAa,kCAAmC,YAAW,gBAAgB;IAE7D,OAAO,CAAC,gBAAgB;IADpC,OAAO,CAAC,aAAa,CAAc;gBACf,gBAAgB,EAAE,gBAAgB;IAI/C,cAAc,IAAI,OAAO;IAKnB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAiCxF"}
|
package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { hashObject } from "../../utils/hashObject.js";
|
|
2
|
+
import { createParallelQueryResult } from "../parallelQueryResult.js";
|
|
3
|
+
import { getInitialHeader } from "../headerUtils.js";
|
|
2
4
|
/** @hidden */
|
|
3
5
|
export class UnorderedDistinctEndpointComponent {
|
|
4
6
|
executionContext;
|
|
@@ -8,15 +10,25 @@ export class UnorderedDistinctEndpointComponent {
|
|
|
8
10
|
this.hashedResults = new Set();
|
|
9
11
|
}
|
|
10
12
|
hasMoreResults() {
|
|
11
|
-
|
|
13
|
+
const result = this.executionContext.hasMoreResults();
|
|
14
|
+
return result;
|
|
12
15
|
}
|
|
13
16
|
async fetchMore(diagnosticNode) {
|
|
14
17
|
const buffer = [];
|
|
15
18
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
16
|
-
if (response
|
|
17
|
-
|
|
19
|
+
if (!response) {
|
|
20
|
+
const result = createParallelQueryResult([], new Map(), {}, undefined);
|
|
21
|
+
return { result, headers: getInitialHeader() };
|
|
18
22
|
}
|
|
19
|
-
|
|
23
|
+
if (response.result === undefined ||
|
|
24
|
+
!Array.isArray(response.result.buffer) ||
|
|
25
|
+
response.result.buffer.length === 0) {
|
|
26
|
+
const result = createParallelQueryResult([], new Map(), {}, undefined);
|
|
27
|
+
return { result, headers: response.headers };
|
|
28
|
+
}
|
|
29
|
+
const parallelResult = response.result;
|
|
30
|
+
const dataToProcess = parallelResult.buffer;
|
|
31
|
+
for (const item of dataToProcess) {
|
|
20
32
|
if (item) {
|
|
21
33
|
const hashedResult = await hashObject(item);
|
|
22
34
|
if (!this.hashedResults.has(hashedResult)) {
|
|
@@ -25,7 +37,8 @@ export class UnorderedDistinctEndpointComponent {
|
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
39
|
}
|
|
28
|
-
|
|
40
|
+
const result = createParallelQueryResult(buffer, new Map(), undefined, undefined);
|
|
41
|
+
return { result, headers: response.headers };
|
|
29
42
|
}
|
|
30
43
|
}
|
|
31
44
|
//# sourceMappingURL=UnorderedDistinctEndpointComponent.js.map
|