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

feat: Add scalar function humanize #5073

Merged
merged 8 commits into from
May 3, 2022
Merged

Conversation

cadl
Copy link
Contributor

@cadl cadl commented Apr 27, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Add new scalar function humanize_size and humanize_number.

Example:

mysql> SELECT HUMANIZE_NUMBER(11230000.0);
+---------------------------+
| HUMANIZE_NUMBER(11230000) |
+---------------------------+
| 11.23 million             |
+---------------------------+

mysql> SELECT HUMANIZE_SIZE(1024 * 1024);
+------------------------------+
| HUMANIZE_SIZE((1024 * 1024)) |
+------------------------------+
| 1.00 MiB                     |
+------------------------------+
1 row in set (0.03 sec)

Changelog

  • New Feature

Related Issues

Fixes #5035

@vercel
Copy link

vercel bot commented Apr 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) May 3, 2022 at 3:03PM (UTC)

@mergify
Copy link
Contributor

mergify bot commented Apr 27, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Apr 27, 2022
@cadl
Copy link
Contributor Author

cadl commented Apr 28, 2022

WIP on #5035 (comment)

kB/KB/MB always leads to a lot of misunderstandings, we just use the KiB
Copy link
Member

@sundy-li sundy-li left a comment

Choose a reason for hiding this comment

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

Impressive!

Copy link
Member

@BohuTANG BohuTANG left a comment

Choose a reason for hiding this comment

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

💯

@BohuTANG
Copy link
Member

BohuTANG commented May 3, 2022

@mergify update

@mergify
Copy link
Contributor

mergify bot commented May 3, 2022

update

✅ Branch has been successfully updated

@mergify mergify bot merged commit f1b947a into databendlabs:main May 3, 2022
@cadl cadl deleted the issue-5035 branch May 3, 2022 15:57
@BohuTANG BohuTANG mentioned this pull request May 12, 2022
55 tasks
@Xuanwo Xuanwo added this to the v0.8 milestone May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature(function): add scalar function humanize
5 participants