Skip to content

Implement head and taste operators #2891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 30, 2023
Merged

Conversation

dominiklohmann
Copy link
Member

@dominiklohmann dominiklohmann commented Jan 29, 2023

The head [n] operator limits the result to the first n events. The limit defaults to 1.

The taste [n] operator behaves similarly, except that the limit is applied per unique schema. E.g., running vast export json 'taste' will return exactly one event of each schema in the database.

### Tasks
- [ ] https://github.com/tenzir/vast/pull/2889
- [ ] https://github.com/tenzir/vast/pull/2890
- [x] Implement `head [n]`
- [x] Implement `taste [n]`
- [x] Unit or integration tests
- [x] Documentation

The `head [n]` operator limits the result to the first `n` events. The
limit defaults to 1.

The `taste [n]` operator behaves similarly, except that the limit is
applied per unique schema. E.g., running `vast export json 'taste'` will
return exactly one event of schema in the database.
@dominiklohmann dominiklohmann added the feature New functionality label Jan 29, 2023
@dominiklohmann dominiklohmann marked this pull request as ready for review January 30, 2023 10:59
mavam
mavam previously requested changes Jan 30, 2023
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need N = 10 as default to match the users' expectation from other tools.

Copy link

@Dakostu Dakostu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into the code and played around with the operators a bit and I don't see any (big) problems. So it's an approval from me. I did leave some comments though. Good luck with the demo!

Base automatically changed from topic/preserve-import-time to master January 30, 2023 14:19
@dominiklohmann dominiklohmann merged commit f6407cc into master Jan 30, 2023
@dominiklohmann dominiklohmann deleted the topic/taste-and-head branch January 30, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants