mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
impl (#43283)
This commit is contained in:
parent
451fb07115
commit
11b535d443
@ -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.
|
||||
|
@ -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"}});
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user