Replies: 7 comments 8 replies
-
Hi @aborruso & sorry for the delay! Is this related to #346 ? |
Beta Was this translation helpful? Give feedback.
-
Hi @aborruso -- There are several things going on here
In sum I had Miller's JSON output omit the enclosing The questions reduce to:
|
Beta Was this translation helpful? Give feedback.
-
Hi @johnkerl, in my guide in Italian under construction, following questions that friends and colleagues have asked me, I have inserted at the top a warning: something like "Miller's default output JSON is not really a JSON". And then I have added a note about the Miller 5 default output (it's the great JSON Lines format) and a note about Miller 6 default output. It is a bit long, but it seems necessary to me. Thank you |
Beta Was this translation helpful? Give feedback.
-
Miller 5 and Miller 6 both have I thought JSON lines (https://jsonlines.org/) had the requirement of letting "header" be in the first record and "data" in subsequents -- as in CSV -- but that's not part of the JSON lines spec. What is part of the JSON lines spec is utf-8 encoding and I'm not definitely doing that in Miller 5 or 6.
|
Beta Was this translation helpful? Give feedback.
-
I am mistaken:
Maybe we should have
|
Beta Was this translation helpful? Give feedback.
-
@aborruso Another way I've been thinking about backward-compatibility issues is they affect only people who were using Miller before Miller 6 -- they don't affect new users. Adhering overmuch to backward-compatible awkward behavior might turn off new users from using the tool. So it's perhaps worth making some well-justified and well-documented non-backward-compatible changes (which is what 'major' versions like 5.x.x. -> 6.x.x are for) -- documenting them clearly so existing users know what to change in their scripts; making the default behavior less awkward so hopefully more future users will use and enjoy the tool. I think I'll do as proposed above. There will be a goodly amount of doc mods now that there will be two formats -- JSON and JSON Lines -- which will touch many doc pages. |
Beta Was this translation helpful? Give feedback.
-
@aborruso #844 and https://miller.readthedocs.io/en/latest/new-in-miller-6/#json-and-json-lines-formatting |
Beta Was this translation helpful? Give feedback.
-
Dear @johnkerl ,
using mlr is already possible to work with this kind of file format. It is more and more used, because it is much more comfortable in terms of processing.
If I have this CSV
and run
I have
This standard JSON output is a wrong JSON, whether you consider it as a JSON or as a JSON Lines.
In my opinion it would be better that when you set simply
--c2j
, mlr will have also "inside" it the--jlistwrap
flag.And you could add JSON Lines format, in which mlr will have "inside" it the
--no-jvstack
flag to have:It occurred to me, because I had to work with standard mlr JSON output, and my client couldn't read it, because it wasn't a real JSON Lines file.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions