From 67bb63394288ab38c36e9c5df4cb932f9fee156f Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 13 Sep 2024 18:02:45 +0530 Subject: [PATCH] fix changefeed --- .../src/ChangeFeed/ChangeFeedIteratorCore.cs | 2 +- .../src/ChangeFeed/ChangeFeedQuerySpec.cs | 6 +++--- .../BaselineTest/BaselineTests.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs index fff2295e5d..a04723b703 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs @@ -229,7 +229,7 @@ public override async Task ReadNextAsync(CancellationToken canc operationType: OperationType.ReadFeed, requestOptions: this.changeFeedRequestOptions, task: (trace) => this.ReadNextInternalAsync(trace, cancellationToken), - openTelemetry: new (OpenTelemetryConstants.Operations.QueryChangeFeed, (response) => new OpenTelemetryResponse(responseMessage: response, querySpec: this.querySpec)), + openTelemetry: new (OpenTelemetryConstants.Operations.QueryChangeFeed, (response) => new OpenTelemetryResponse(responseMessage: response, querySpec: this.changeFeedQuerySpec?.ToSqlQuerySpec())), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedQuerySpec.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedQuerySpec.cs index c5c8ed4636..4099181ee3 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedQuerySpec.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedQuerySpec.cs @@ -56,11 +56,11 @@ internal bool ShouldSerializeQueryText() } /// - /// Returns if query is parameterized + /// Converts to SQL Query Specs /// - public bool IsParameterized() + internal SqlQuerySpec ToSqlQuerySpec() { - return false; + return new SqlQuerySpec(this.QueryText); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs index 4fd6299edd..62f20f1fe4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs @@ -63,10 +63,10 @@ public void ExecuteTestSuite(IEnumerable inputs, [CallerMemberName] stri List baselineTestResults = new List(); int inputId = 0; int totalInputs = inputs.Count(); - Console.WriteLine($"Total inputs: {totalInputs}"); + Debug.WriteLine($"Total inputs: {totalInputs}"); foreach (TInput input in inputs) { - Console.WriteLine($"Execute input {++inputId}: {input.Description}.."); + Debug.WriteLine($"Execute input {++inputId}: {input.Description}.."); TOutput output = this.ExecuteTest(input); baselineTestResults.Add(new BaselineTestResult(input, output)); }