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

The result is wrong when I loading a JSON file with path specified #96

Closed
xwjdsh opened this issue Oct 5, 2022 · 0 comments · Fixed by #99
Closed

The result is wrong when I loading a JSON file with path specified #96

xwjdsh opened this issue Oct 5, 2022 · 0 comments · Fixed by #99
Labels
bug Something isn't working

Comments

@xwjdsh
Copy link
Contributor

xwjdsh commented Oct 5, 2022

Describe the bug and expected behavior
The result is wrong when I loading a JSON file with path specified.

Reproduction steps

~ cat test.json
{
  "data": {
    "data1": [
      {"id": 1, "name": "Corah"},
      {"id": 3, "name": "Minh"}
    ],
    "data2": [
      {"id": 2, "name": "Corah"},
      {"id": 4, "name": "Minh"}
    ]
  },
  "total": 2
}

~ ./dsq --pretty test.json 'SELECT * FROM {"data.data2"} ORDER BY id DESC'
+----+-------+
| id | name  |
+----+-------+
|  3 | Minh  |
|  1 | Corah |
+----+-------+
(2 rows)

The expected result should be,

+----+-------+
| id | name  |
+----+-------+
|  4 | Minh  |
|  2 | Corah |
+----+-------+
(2 rows)

Versions

  • OS: macOS 12.3.1
  • Shell: zsh
  • dsq version: 0.22.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant