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

Read data from stdin #21

Open
GuillaumeDesforges opened this issue Oct 3, 2023 · 1 comment
Open

Read data from stdin #21

GuillaumeDesforges opened this issue Oct 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@GuillaumeDesforges
Copy link

GuillaumeDesforges commented Oct 3, 2023

Description

The README shows how a SQL command can be passed to the command via stdin.

Would it be possible to pipe data (in my case JSONL) via stdin, and write a query in argument, much like jq?

Something like that maybe?

$ cat data.jsonl
{"id":1,"name":"Guillaume"}
{"id":2,"name":"Sophie"}
$ cat data.jsonl | polars 'SELECT id, name FROM read_json(stdin())'
┌──────┬───────────┐
│ id   ┆ name      │
│ ---  ┆ ---       │
│ i64  ┆ str       │
╞══════╪═══════════╡
│ 1    ┆ Guillaume │
│ 2    ┆ Sophie    │
@GuillaumeDesforges GuillaumeDesforges added the enhancement New feature or request label Oct 3, 2023
@stinodego
Copy link
Member

This looks very useful! Would be nice to have, for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants