rg-opendal, a ripgrep-style search CLI over OpenDAL objects #7780
TennyZhuang
started this conversation in
Show and tell
Replies: 1 comment
|
Mailing list thread: https://lists.apache.org/thread/6so6n0jc1s932b9bp349f8nm3mrrkw7x |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Background
ripgrep ships its core matching/searching/printing logic as public crates on crates.io:
grep-searcher,grep-regex,grep-matcher,grep-printer,ignore. Those crates expose stable APIs for embedding ripgrep's regex engine and output behavior in other tools without forking ripgrep itself.rg-opendal uses those crates, with OpenDAL as the I/O layer, to bring ripgrep-compatible search to S3-compatible object stores. The CLI takes the form
rg-opendal <pattern> s3://bucket/prefix/and aims to mirror nativerg's flag set and output format on object-store inputs.Current status
Early-stage feasibility study. The crate is a single repository with
[lib] + [[bin]]structure plus a separatebenchmarks/seam-a/microbenchmark crate. Verification is shell-harness-based: each feature family has a script that diffs the binary's output against nativergon a fixture hosted in a local MinIO instance.Two reader strategies are wired:
--streaming) that bridges OpenDAL'sBufferStreamto syncstd::io::ReadviaHandle::block_on. Local benchmark on 2.7–525 MB files measured the per-chunk bridge cost at ≤1% of total search time; the dominant cost is S3 I/O.Implemented scope
The following ripgrep flag families have feature-parity-attested implementations against native
rg's output on a MinIO fixture (the per-family status table is in MATRIX.md):-i).-g,-t,-T);-tcoverage is currently unit-test-level rather than full output-parity.--json,-A/-B/-C,--stats).--color=auto|always|never).-c,-l).-w,-x).-m).-v).-N,--column,--heading).-I,-H).-0) and NUL-separated records (-z).-a) — flag-acceptance smoke only at this point.-F) — spot-checked, dedicated harness pending.--streaming), with output-parity-attested against the default reader.One small convention from working with OpenDAL: each harness probes
op.info().full_capability().<flag>and skips a test rather than failing it when the underlying service doesn't support a capability. That keeps the service-vs-feature axes clean during development.Known limitations
-a/--textfamily is flag-accepted but not yet output-parity attested against nativerg.-F/--fixed-stringsfamily has been spot-checked but does not yet have a dedicated harness.Questions for the community
grep-*from crates.io, with OpenDAL as the I/O layer) reasonable from the OpenDAL maintainers' perspective?grep-*(or another syncRead-consuming searcher) withBufferStreambefore? If so, are there pitfalls or conventions on the streaming-bridge pattern we should know about?Repo: https://github.com/TennyZhuang/rg-opendal
Thanks for OpenDAL — happy to take any feedback or pointers.
All reactions