mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #57592 from bharatnc/ncb/alias-format-readable-size
Add FORMAT_BYTES as an alias for formatReadableSize
This commit is contained in:
commit
11920e751a
@ -628,6 +628,8 @@ SELECT
|
||||
formatReadableSize(filesize_bytes) AS filesize
|
||||
```
|
||||
|
||||
Alias: `FORMAT_BYTES`.
|
||||
|
||||
``` text
|
||||
┌─filesize_bytes─┬─filesize───┐
|
||||
│ 1 │ 1.00 B │
|
||||
|
@ -21,6 +21,7 @@ namespace
|
||||
REGISTER_FUNCTION(FormatReadableSize)
|
||||
{
|
||||
factory.registerFunction<FunctionFormatReadable<Impl>>();
|
||||
factory.registerAlias("FORMAT_BYTES", Impl::name, FunctionFactory::CaseInsensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
WITH round(exp(number), 6) AS x, x > 0xFFFFFFFFFFFFFFFF ? 0xFFFFFFFFFFFFFFFF : toUInt64(x) AS y, x > 0x7FFFFFFF ? 0x7FFFFFFF : toInt32(x) AS z
|
||||
SELECT formatReadableSize(x), formatReadableSize(y), formatReadableSize(z)
|
||||
SELECT FORMAT_BYTES(x), format_bytes(y), formatReadableSize(z)
|
||||
FROM system.numbers
|
||||
LIMIT 70;
|
||||
|
Loading…
Reference in New Issue
Block a user