Skip to content

Error querying empty json file #97

@ghost

Description

Describe the bug and expected behavior
Querying an emtpy JSON file results in an (unexpected) error. I was expecting an empty result set, but no error.

Reproduction steps
Input file empty.json:

[ ]

Running query:

$ dsq empty.json  "select * from {}"
Input is not an array of objects: empty.json.

The same happens with an empty (no lines) input file empty.jsonl.

Versions

  • OS: Linux 5.10.0-18-amd64 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux
  • Shell: bash
  • dsq version: latest (should be 0.22.0)

Additional context, screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions