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

Implement proper deserialization of EsqlQueryResponse #8062

Merged
merged 3 commits into from Mar 25, 2024
Merged

Implement proper deserialization of EsqlQueryResponse #8062

merged 3 commits into from Mar 25, 2024

Conversation

flobernd
Copy link
Member

Uses CustomResponseBuilder to property deserialize EsqlQueryResponse.

Additional changes:

  • Mark all RequestParameters with the partial modifier.
  • Regenerate client using the latest spec

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a general q? on the response mapping.


public sealed partial class EsqlQueryResponse
{
public byte[] Data { get; init; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we gonna expose this more concretely in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mpdreamz The response is modelled like this in the specification:

export class Response {
  body: EsqlColumns
}

export type EsqlColumns = ArrayBuffer

Depending on the "format" query parameter, this buffer might contain JSON, CSV, ... (and even a binary Arrow dataframe in the future). Internally, we call this the "raw API".

The plan is to provide helper functions on top of the raw API for different usecases. Not all clients will implement the same high level helpers, but for .NET I'll definitely want to add at least the "Object API" (aka simple deserialization into source classes) and the "Arrow Dataframe API".

@flobernd flobernd added 8.x Relates to 8.x client version v8.12.1 backport 8.12 backport 8.13 and removed Feature labels Mar 25, 2024
@flobernd flobernd merged commit aa42561 into main Mar 25, 2024
27 checks passed
@flobernd flobernd deleted the esql2 branch March 25, 2024 12:36
flobernd added a commit that referenced this pull request Mar 25, 2024
Co-authored-by: Florian Bernd <git@flobernd.de>
flobernd added a commit that referenced this pull request Mar 25, 2024
Co-authored-by: Florian Bernd <git@flobernd.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to 8.x client version backport 8.12 backport 8.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants