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 param for attaching fields to response json #469

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

trueleo
Copy link
Contributor

@trueleo trueleo commented Aug 7, 2023

Description

This PR adds query parameters to format response output. Mainly duplicating existing fill null option to query param and adding a withFields param options.

Attaching schema to output can benefit cases where client wants to display table but the table API wants all table columns to be defined first.

Example

{{endpoint}}/api/v1/query?fields=true
"query": "select min(p_timestamp), max(p_timestamp) from {{stream_name}}",
....
{
    "fields": [
        "MIN(app.p_timestamp)",
        "MAX(app.p_timestamp)"
    ],
    "records": [
        {
            "MAX(app.p_timestamp)": "2023-08-07T05:55:59.738",
            "MIN(app.p_timestamp)": "2023-08-07T05:55:20.335"
        }
    ]
}

This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Copy link
Member

@nitisht nitisht left a comment

Choose a reason for hiding this comment

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

small change, other wise LGTM

@nitisht nitisht merged commit 30e7f96 into parseablehq:main Aug 7, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2023
@trueleo trueleo deleted the query_output branch August 15, 2023 05:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants