-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Use correct abbreviations for data quantities. Fixes #13054 #14859
Conversation
Since Trino uses base-2 units everywhere, I think it would be better to keep the base-2 units and but add the The downside of adding the suffix is that it will break all of the carefully formatted output, since the values will now be wider. But as long as we still fit in 80 characters, it should be ok. We could also add a non-default command line option to use base-10 units, so as not to change the existing behavior. You can use a configuration file to effectively make this a default for your CLI installation. |
9a8ab09
to
affc258
Compare
The impact on the formatting of the CLI is minimal:
Same query with
|
@electrum Your comments seem to be addressed. Can you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % @electrum's review.
|
||
import static org.testng.Assert.assertEquals; | ||
|
||
public class TestFormatUtils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this.
👋 @metadaddy - this PR has become inactive. We hope you are still interested in working on it. Please let us know, and we can try to get reviewers to help with that. We're working on closing out old and inactive PRs, so if you're too busy or this has too many merge conflicts to be worth picking back up, we'll be making another pass to close it out in a few weeks. |
Thanks for reminder @mosabua. Sorry @metadaddy that this fell through the cracks. I think we can just rebase this and merge. I'll wait a few days for @metadaddy if he does the rebase otherwise I'll do a rebase and merge. |
@hashhar Hey there - apologies for the latency in replying! I can rebase if you like - it should be relatively straightforward. |
affc258
to
c944f12
Compare
Something messed up here. I'll figure it out and re-push! |
909c461
to
0b66544
Compare
@hashhar Looks like everything is good to go. |
Could you add the new flag to the documentation @metadaddy .. if timing for merge doesnt work out I can review a separate follow up PR as well |
0b66544
to
5dec5ab
Compare
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Default is unchanged and is opt-in.
Only affects CLI. format
related functions in Trino still behave same as before.
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
Description
The Trino CLI currently reports data size incorrectly, using the legacy, 1,024-based, values for K, M, G etc rather than the modern 1,000-based values.
Fix
CLI
Non-technical explanation
This change corrects the display of data sizes in the CLI to use KiB, MiB for 1,024-based values and adds a command option,
--decimal-data-size
to display data sizes in 1,000-based units.Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:
The CLI now shows data sizes and rates with binary (1024-based) abbreviations: KiB, MiB, etc. A new command option,
--decimal-data-size
, shows decimal (1000-based) values and abbreviations: KB, MB, etc. (#13054)Related issues, pull requests, and links