Skip to content

Read data from stdin #21

Open
Open
@GuillaumeDesforges

Description

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    │

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions