Skip to content

Commit

Permalink
Feature/full text functionality (#31692)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR


### Issues associated with this PR


### Describe the problem that is addressed by this PR


### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)

---------

Co-authored-by: Manik Khandelwal <[email protected]>
Co-authored-by: Ujjwal Soni <[email protected]>
  • Loading branch information
3 people authored Nov 8, 2024
1 parent aaf45f4 commit 636e745
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class HybridQueryExecutionContext implements ExecutionContext {
this.state === HybridQueryExecutionContextBaseStates.initialized) &&
this.buffer.length === 0
) {
await this.fetchMore(diagnosticNode, nextItemRespHeaders);
await this.fetchMoreInternal(diagnosticNode, nextItemRespHeaders);
}

if (this.buffer.length > 0) {
Expand All @@ -112,30 +112,34 @@ export class HybridQueryExecutionContext implements ExecutionContext {
}
}

public async fetchMore(
public async fetchMore(diagnosticNode: DiagnosticNodeInternal): Promise<Response<any>> {
let fetchMoreRespHeaders = getInitialHeader();
return await this.fetchMoreInternal(diagnosticNode, fetchMoreRespHeaders);
}

private async fetchMoreInternal(
diagnosticNode: DiagnosticNodeInternal,
nextItemRespHeaders?: CosmosHeaders,
headers: CosmosHeaders,
): Promise<Response<any>> {
let fetchMoreRespHeaders = nextItemRespHeaders ? nextItemRespHeaders : getInitialHeader();
switch (this.state) {
case HybridQueryExecutionContextBaseStates.uninitialized:
await this.initialize(diagnosticNode, fetchMoreRespHeaders);
await this.initialize(diagnosticNode, headers);
return {
result: [],
headers: fetchMoreRespHeaders,
headers: headers,
};

case HybridQueryExecutionContextBaseStates.initialized:
await this.executeComponentQueries(diagnosticNode, fetchMoreRespHeaders);
await this.executeComponentQueries(diagnosticNode, headers);
return {
result: [],
headers: fetchMoreRespHeaders,
headers: headers,
};
case HybridQueryExecutionContextBaseStates.draining:
const result = await this.drain(fetchMoreRespHeaders);
const result = await this.drain(headers);
return result;
case HybridQueryExecutionContextBaseStates.done:
return this.done(fetchMoreRespHeaders);
return this.done(headers);
default:
throw new Error(`Invalid state: ${this.state}`);
}
Expand Down

0 comments on commit 636e745

Please sign in to comment.