Skip to content

feat(http): add support for nm=true query parameter in text export (/exp) to exclude metadata#4639

Merged
bluestreak01 merged 1 commit intomasterfrom
jh_nometa_for_exp
Jun 14, 2024
Merged

feat(http): add support for nm=true query parameter in text export (/exp) to exclude metadata#4639
bluestreak01 merged 1 commit intomasterfrom
jh_nometa_for_exp

Conversation

@jerrinot
Copy link
Copy Markdown
Contributor

Add nm=true as a query parameter to exclude headers in CSV exports. This is useful for scripting data-based monitoring tasks.

Example, return ingestion lag in milliseconds:

$ curl -G "http://localhost:9000/exp" --data-urlencode "query=SELECT (now () - max(timestamp)) / 1000 from trades;" --data-urlencode "nm=true"
210

This returns only the query result, omitting any metadata, which allows monitoring without requiring additional post-processing.

Additionally, the nm parameter was already supported in the JSON (/exec) endpoint, and this PR improves the consistency of the QuestDB REST interface.

Fixes #4629

…(/exp) to exclude metadata

Add "nm=true" as a query parameter to exclude headers in CSV exports.
This is useful for scripting data-based monitoring tasks.

Example, return ingestion lag in milliseconds:
```
$ curl -G "http://localhost:9000/exp" --data-urlencode "query=SELECT (now () - max(timestamp)) / 1000 from trades;" --data-urlencode "nm=true"
210
```

This returns only the query result, omitting any metadata,
which allows monitoring without requiring additional post-processing.

Additionally, the 'nm' parameter was already supported in the
JSON (/exec) endpoint, and this PR enhances the consistency
of the QuestDB REST interface.

Fixes #4629
@jerrinot jerrinot added Enhancement Enhance existing functionality REST API Issues or changes relating to the HTTP endpoints Java Improvements that update Java code labels May 31, 2024
@jerrinot jerrinot changed the title feat(http): add support for "nm=true" query parameter in text export (/exp) to exclude metadata feat(http): add support for nm=true query parameter in text export (/exp) to exclude metadata May 31, 2024
@jerrinot
Copy link
Copy Markdown
Contributor Author

docs PR will follow

@jerrinot
Copy link
Copy Markdown
Contributor Author

a failure due to a completely unrelated #4374 :(

@ideoma
Copy link
Copy Markdown
Collaborator

ideoma commented May 31, 2024

[PR Coverage check]

😍 pass : 9 / 9 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cutlass/http/processors/TextQueryProcessor.java 9 9 100.00%

@bluestreak01 bluestreak01 merged commit 7bcecaa into master Jun 14, 2024
@bluestreak01 bluestreak01 deleted the jh_nometa_for_exp branch June 14, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Enhance existing functionality Java Improvements that update Java code REST API Issues or changes relating to the HTTP endpoints

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support for the no-metadata parameter in /exp

4 participants