Skip to content
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

Persistent zed preferences (aka ".zedrc") #1059

Open
philrz opened this issue Aug 3, 2020 · 2 comments
Open

Persistent zed preferences (aka ".zedrc") #1059

philrz opened this issue Aug 3, 2020 · 2 comments

Comments

@philrz
Copy link
Contributor

philrz commented Aug 3, 2020

In keeping with what users often expect from UNIX command-line tools, it has been proposed that zq should have smart defaults for what happens when it's invoked with few/no arguments. However, the definition of what's "smart" might be quite different based on a user persona or use case. That is, our idea of a sensible default might not match theirs. To give a few examples:

  1. A user that works largely in a particular data format (NDJSON, Parquet, ZSON, etc.) might want to always have zq output that format without having to specify a -f option.

  2. Likewise, a user that is always reading files of a particular input format that doesn't happen to be supported by the auto-detection (e.g. Parquet) might want to always have zq attempt to input in that format without having to specify the -i option.

  3. A user may have user-defined functions, user-defined operators, or const/type values they always want applied as if they'd invoked them via the -I option.

  4. A user running on a system with excess resources may want a consistently raised ceiling for -sortmem and/or -fusemem parameters.

  5. A user with preferences for epoch timestamps may want the -E option consistently applied (this was discussed in the context of an issue from the community Consistent timestamp output formatting #1002 where the user expressed support for the concept of persistent preferences, but in that case we addressed the user's primary concern by just moving to ISO timestamps by default for all relevant formats.)

There's surely multiple ways we could implement this. An approach I’d put on the table in the past would be something similar to $HOME/.gitconfig, since it provides a readable text-based summary of the current preferences along with its companion git config that allows for easy viewing/setting of values. That said, given the push toward cloud-friendly tooling, something YAML-based has also been proposed.

@philrz philrz changed the title Persistent zq preferences Persistent zed preferences Apr 19, 2021
@philrz
Copy link
Contributor Author

philrz commented Apr 19, 2021

@mccanne  pointed out that the changes proposed in #2586 will make it easier for us to implement these persistent preferences, since having one set of global flags means there's no need to maintain complicated hierarchical config about which flags apply where.

@philrz philrz added this to the Data MVP0 milestone Apr 21, 2021
@philrz philrz modified the milestones: Data MVP0, Data MVP1 May 10, 2021
@mccanne mccanne removed their assignment Nov 9, 2021
@philrz philrz removed this from the ETL Lake milestone Oct 25, 2022
@philrz philrz changed the title Persistent zed preferences Persistent zed preferences (aka ".zedrc") Feb 16, 2024
@philrz
Copy link
Contributor Author

philrz commented Feb 16, 2024

After learning about user-defined operators a and user-defined functions a community user recently mentioned in a Slack thread how handy this would be. In their own words:

Would be neat if there was a ~/.zedrc where you could autoload user-defined functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants