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

feat: Add json lines support to query output #25698

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Conversation

mgattozzi
Copy link
Contributor

This commit adds support for JSON Lines which also lets us stream the body back to the consumer, rather than needing to buffer the entirety of the query in memory before sending it back to the user.

Closes #24654

This commit adds support for JSON Lines which also lets us stream the
body back to the consumer, rather than needing to buffer the entirety
of the query in memory before sending it back to the user.

Closes #24654
@mgattozzi mgattozzi force-pushed the mgattozzi/json-lines branch from 353a151 to ab5d46d Compare December 20, 2024 19:18
Copy link
Member

@pauldix pauldix left a comment

Choose a reason for hiding this comment

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

nice, hopefully it streams back without OOMing the process on big queries? I guess the real test would be to write in a massive amount of data to a single table and then do a select * against it, doing line count against the result.

TestCase {
database: Some("foo"),
query: "SELECT time, host, region, usage FROM cpu",
expected: "{\"iox::measurement\":\"cpu\",\"time\":\"1970-01-01T00:00:01\",\"host\":\"a\",\"region\":\"us-east\",\"usage\":0.9}\n\
Copy link
Member

Choose a reason for hiding this comment

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

unrelated to this PR, but we should look into changing the name of iox::measurement to influxdb3::table

@mgattozzi
Copy link
Contributor Author

In theory it should since it's an async stream

@mgattozzi mgattozzi merged commit c764d37 into main Dec 20, 2024
13 checks passed
@mgattozzi mgattozzi deleted the mgattozzi/json-lines branch December 20, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JSON Lines in InfluxDB Edge
2 participants