Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query: Removes compute specific logic from query pipelines that is no longer required #4558

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,6 @@ private async Task<ResponseMessage> ReadNextInternalAsync(ITrace trace, Cancella
return responseMessage;
}

public override CosmosElement GetCosmosElementContinuationToken()
{
throw new NotSupportedException();
}

private sealed class ChangeFeedStateFromToChangeFeedCrossFeedRangeState : ChangeFeedStartFromVisitor<TryCatch<ChangeFeedCrossFeedRangeState>>
{
public static readonly ChangeFeedStateFromToChangeFeedCrossFeedRangeState Singleton = new ChangeFeedStateFromToChangeFeedCrossFeedRangeState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ private ChangeFeedPartitionKeyResultSetIteratorCore(

public override bool HasMoreResults => this.hasMoreResultsInternal;

public override CosmosElement GetCosmosElementContinuationToken()
{
throw new NotImplementedException();
}

/// <summary>
/// Get the next set of results from the cosmos service
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,5 @@ internal virtual Task<ResponseMessage> NextResultSetDelegateAsync(
trace: trace,
cancellationToken: cancellationToken);
}

public override CosmosElement GetCosmosElementContinuationToken()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private ClientAggregateQueryPipelineStage(
// all the work is done in the base constructor.
}

public static TryCatch<IQueryPipelineStage> MonadicCreate(
public static new TryCatch<IQueryPipelineStage> MonadicCreate(
neildsh marked this conversation as resolved.
Show resolved Hide resolved
IReadOnlyList<AggregateOperator> aggregates,
IReadOnlyDictionary<string, AggregateOperator?> aliasToAggregateType,
IReadOnlyList<string> orderedAliases,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,21 @@ public AggregateQueryPipelineStage(
}

public static TryCatch<IQueryPipelineStage> MonadicCreate(
ExecutionEnvironment executionEnvironment,
IReadOnlyList<AggregateOperator> aggregates,
IReadOnlyDictionary<string, AggregateOperator?> aliasToAggregateType,
IReadOnlyList<string> orderedAliases,
bool hasSelectValue,
CosmosElement continuationToken,
MonadicCreatePipelineStage monadicCreatePipelineStage) => executionEnvironment switch
{
ExecutionEnvironment.Client => ClientAggregateQueryPipelineStage.MonadicCreate(
aggregates,
aliasToAggregateType,
orderedAliases,
hasSelectValue,
continuationToken,
monadicCreatePipelineStage),
ExecutionEnvironment.Compute => ComputeAggregateQueryPipelineStage.MonadicCreate(
MonadicCreatePipelineStage monadicCreatePipelineStage)
{
return ClientAggregateQueryPipelineStage.MonadicCreate(
aggregates,
aliasToAggregateType,
orderedAliases,
hasSelectValue,
continuationToken,
monadicCreatePipelineStage),
_ => throw new ArgumentException($"Unknown {nameof(ExecutionEnvironment)}: {executionEnvironment}."),
};
monadicCreatePipelineStage);
}

/// <summary>
/// Struct for getting the payload out of the rewritten projection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ private static TryCatch<IQueryPipelineStage> TryCreateSpecializedDocumentQueryEx
inputParameters.PartitionKey,
inputParameters.Properties,
inputParameters.PartitionedQueryExecutionInfo,
inputParameters.ExecutionEnvironment,
inputParameters.ReturnResultsInDeterministicOrder,
inputParameters.EnableOptimisticDirectExecution,
inputParameters.IsNonStreamingOrderByQueryFeatureDisabled,
Expand Down Expand Up @@ -559,7 +558,6 @@ private static TryCatch<IQueryPipelineStage> TryCreateSpecializedDocumentQueryEx
$"Invalid MaxItemCount {optimalPageSize}");

return PipelineFactory.MonadicCreate(
executionEnvironment: inputParameters.ExecutionEnvironment,
documentContainer: documentContainer,
sqlQuerySpec: inputParameters.SqlQuerySpec,
targetRanges: targetRanges
Expand Down Expand Up @@ -831,7 +829,6 @@ public sealed class InputParameters
private const int DefaultMaxItemCount = 1000;
private const int DefaultMaxBufferedItemCount = 1000;
private const bool DefaultReturnResultsInDeterministicOrder = true;
private const ExecutionEnvironment DefaultExecutionEnvironment = ExecutionEnvironment.Client;

public InputParameters(
SqlQuerySpec sqlQuerySpec,
Expand All @@ -843,7 +840,6 @@ public InputParameters(
PartitionKey? partitionKey,
IReadOnlyDictionary<string, object> properties,
PartitionedQueryExecutionInfo partitionedQueryExecutionInfo,
ExecutionEnvironment? executionEnvironment,
bool? returnResultsInDeterministicOrder,
bool enableOptimisticDirectExecution,
bool isNonStreamingOrderByQueryFeatureDisabled,
Expand Down Expand Up @@ -877,7 +873,6 @@ public InputParameters(
this.PartitionKey = partitionKey;
this.Properties = properties;
this.PartitionedQueryExecutionInfo = partitionedQueryExecutionInfo;
this.ExecutionEnvironment = executionEnvironment.GetValueOrDefault(InputParameters.DefaultExecutionEnvironment);
this.ReturnResultsInDeterministicOrder = returnResultsInDeterministicOrder.GetValueOrDefault(InputParameters.DefaultReturnResultsInDeterministicOrder);
this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution;
this.IsNonStreamingOrderByQueryFeatureDisabled = isNonStreamingOrderByQueryFeatureDisabled;
Expand All @@ -893,7 +888,6 @@ public InputParameters(
public PartitionKey? PartitionKey { get; }
public IReadOnlyDictionary<string, object> Properties { get; }
public PartitionedQueryExecutionInfo PartitionedQueryExecutionInfo { get; }
public ExecutionEnvironment ExecutionEnvironment { get; }
public bool ReturnResultsInDeterministicOrder { get; }
public TestInjections TestInjections { get; }
public bool EnableOptimisticDirectExecution { get; }
Expand All @@ -911,7 +905,6 @@ public InputParameters WithContinuationToken(CosmosElement token)
this.PartitionKey,
this.Properties,
this.PartitionedQueryExecutionInfo,
this.ExecutionEnvironment,
this.ReturnResultsInDeterministicOrder,
this.EnableOptimisticDirectExecution,
this.IsNonStreamingOrderByQueryFeatureDisabled,
Expand Down
Loading
Loading