Top
Best
New

Posted by pistolario 18 hours ago

A Faster Alternative to Jq(micahkepe.com)
364 points | 229 commentspage 5
quotemstr 17 hours ago|
Reminder you can also get DuckDB to slurp the JSON natively and give you a much more expressive query model than anything jq-like.
maleldil 10 hours ago|
How does it deal with nested objects? E.g. one of the fields/columns is an array of objects.
quotemstr 1 minute ago||
Beautifully. UNNEST works well, as do the pivot operators.
commers148 7 hours ago||
[dead]
leontloveless 14 hours ago||
[dead]
mitul005 14 hours ago||
[dead]
marxisttemp 15 hours ago||
Many Useless Uses of cat in this documentation. You never need to do `cat file | foo`, you can just do `<file foo`. cat is for concatenating inputs, you never need it for a single input.
norenh 8 hours ago|
As someone who worked with Unix/Linux and command line arguments for 30 years and still "abuse" cat like the documentation, I regularly hear this complaint.

Yes, "cmd <file" is more efficient for the computer but not for the reader in many cases. I read from left to the right and the pipeline might be long or "cmd" might have plenty of arguments (or both). Having "cat file | cmd" immediately gives me the context for what I am working with and corresponds well with "take this file, do this, then that, etc" with it) and makes it easier for me to grok what is happening (the first operation will have some kind of input from stdin). Without that, the context starts with the (first) operation like in the sentence "do this operation, on this file (,then this, etc)". I might not be familiar with it or knowing the arguments it expects.

At least for me, the first variant comes more naturally and is quicker to follow (in most cases), so unless it is performance sensitive that is what I end up with (and cat is insanely fast for most cases).

jasomill 5 hours ago||
If left-to-right is your main concern, observe that the post you replied to uses

  <file command
which is equivalent to

  command <file
silverwind 15 hours ago||
Effort would be better investigated making `jq` itself faster.
adastra22 17 hours ago|
The fastest alternative to jq is to not use JSON.