Open mon-jai opened 1 year ago
Here's a way you can work around this:
$ dsq user_addresses.json 'select location->>"address" FROM {}'
[{"location->>\"address\"":"{\"number\":1002}"},
{"location->>\"address\"":"{\"number\":19}"},
{"location->>\"address\"":null}]
@eatonphil That is great. But it won't work if every record contains the location
field, so won't work consistently on other datasets with the same schema.
Maybe we can add a flag to also include the string representation of objects, regardless of whether or not it can be extracted to sub-fields, like something called --preserve-json-string
?
# location field will present in all situations
$ dsq user_addresses.json 'select location->>"address" FROM {}' --preserve-json-string
But it won't work if every record contains the location field, so won't work consistently on other datasets with the same schema.
I don't understand what you mean by this?
Describe the bug and expected behavior
dsq failed to recognize nested field if its parent object absents in some records.
Reproduction steps
dsq failed to retrieve
location.city
, iflocation
is absent in some records.user_addresses.json
Result:
Expected behavior:
Versions
Linux DESKTOP-IID1F0E 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux