This commit is contained in:
Nikita Taranov 2022-11-17 11:17:27 +01:00 committed by GitHub
parent 451fb07115
commit 11b535d443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type
Uses a linear congruential generator.
## canonicalRand
## randCanonical
The function generates pseudo random results with independent and identically distributed uniformly distributed values in [0, 1).
Non-deterministic. Return type is Float64.

View File

@ -34,7 +34,7 @@ private:
struct NameCanonicalRand
{
static constexpr auto name = "canonicalRand";
static constexpr auto name = "randCanonical";
};
class FunctionCanonicalRand : public FunctionRandomImpl<CanonicalRandImpl, Float64, NameCanonicalRand>
@ -52,7 +52,7 @@ REGISTER_FUNCTION(CanonicalRand)
The function generates pseudo random results with independent and identically distributed uniformly distributed values in [0, 1).
Non-deterministic. Return type is Float64.
)",
Documentation::Examples{{"canonicalRand", "SELECT canonicalRand()"}},
Documentation::Examples{{"randCanonical", "SELECT randCanonical()"}},
Documentation::Categories{"Mathematical"}});
}

View File

@ -1,13 +1,13 @@
select toTypeName(rand(cast(4 as Nullable(UInt8))));
select toTypeName(canonicalRand(CAST(4 as Nullable(UInt8))));
select toTypeName(randCanonical(CAST(4 as Nullable(UInt8))));
select toTypeName(randConstant(CAST(4 as Nullable(UInt8))));
select toTypeName(rand(Null));
select toTypeName(canonicalRand(Null));
select toTypeName(randCanonical(Null));
select toTypeName(randConstant(Null));
select rand(cast(4 as Nullable(UInt8))) * 0;
select canonicalRand(cast(4 as Nullable(UInt8))) * 0;
select randCanonical(cast(4 as Nullable(UInt8))) * 0;
select randConstant(CAST(4 as Nullable(UInt8))) * 0;
select rand(Null) * 0;
select canonicalRand(Null) * 0;
select randCanonical(Null) * 0;
select randConstant(Null) * 0;