Comments (5)
Okay, I can see that INDEX
works, but I have no intent of adding SQL-style operators, as written in the README.
Regarding combinations
, how did you make these compile in jaq? combinations
is defined recursively, so that yields the following error for me:
Error: could not find function
╭─[<unknown>:4:22]
│
4 │ | (.[1:] | combinations) as $y
· ──────┬─────
· ╰─────── could not find function
───╯
from jaq.
@01mf02 - My apologies for erroneously including combinations
. I've added some others that I have tested.
from jaq.
Ok, I have now included normals
and finites
in 0537323. Thanks for your suggestion!
Thanks also for finding that bsearch
compiles correctly; however, because the parser takes too long for my taste to parse such large expressions (~56 seconds on my machine for bsearch
, see also #7), I would like to postpone integrating such filters until the parser is faster.
The other filters (IN
, INDEX
) are SQL-style operators which, as I have already mentioned, I do not wish to include in the standard library (because I do not like some filters to be uppercase, others lowercase etc.).
However, I could imagine something like an sql.jq
module for SQL-style operators in the long run; but then, this would not be usable right now because jaq does not support modules.
from jaq.
Just for reference, I have just sped up the parser in 012c9c5, so filters like bsearch
should be feasible to implement now.
However, I am more inclined to keep the standard library small, so I do not like to include a filter like bsearch
in it.
from jaq.
@01mf02 - Thanks for your careful and considerate explanations. I'm glad you were able to speed up the parser.
Since both IN/1
and INDEX/2
in particular are actually quite important, apart from being useful and widely used, I would like to make a plea on their behalf.
Both are useful and widely used because they are stream-oriented, and in particular because of the efficiency that stream-orientation makes possible. It seems to me that they're also important because they provide convenient access to the stream-oriented foundations of jq. Having standardized definitions of such basic functionality is also very useful. In this regard, I'd like to mention that gojq also supports them.
By the way, neither IN
nor INDEX
is "SQLish" in any meaningful way, at least that I'm aware of. The choice of uppercase names was evidently largely the result of some poor planning --in
and index
had already been documented. If you are absolutely opposed to including filters with uppercase names, then I hope you would consider including them but with names to your liking.
The case for bsearch
is certainly less compelling, and the jaq-based implementation even more so, but having a simple-to-use and standardized binary search function readily available is often really helpful.
For these reasons, as well as for compatibility with both jq and gojq, I would ask that you reconsider their inclusion.
(If the implementation of bsearch
in jaq turns out to be unsatisfactory, it could always be replaced by one written in Rust :-)
Thanks!
from jaq.
Related Issues (20)
- Build failure for v1.3.0 on macos & linux, but building from latest main (1699a7d1fc7ede) works HOT 5
- Problem on console without support of color. HOT 7
- Build failure on 1.80 nightly and Windows HOT 3
- `--argjson` not supported HOT 5
- jaq for Apple Silicon HOT 2
- Bug using | more HOT 6
- Compile error on Windows HOT 6
- Consider creating easy-to-use library version/crate HOT 3
- Feature request: NO_COLOR standard implementation HOT 1
- Different behavior with 'add' filter HOT 3
- [bug] `map_values(@base64d)` results in `undefined filter` HOT 3
- Invalid link in README.md HOT 4
- `halt` and `halt_error` filters HOT 2
- JSON with Comments (jsonc) support HOT 12
- rustc 1.80 fails building --locked from crates.io HOT 4
- Why `ParseCtx.compile` doesn't return a Result? HOT 1
- jaq ignores multiline (`m`) flag in regex operations HOT 4
- reminder re add/1 HOT 1
- Remove entries if array element matches HOT 1
- jaq outputs invalid utf8 escaped json HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jaq.