mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #61308 from rschu1ze/docs-sleep
Docs: Follow up to #61258
This commit is contained in:
commit
7a5ac383e5
@ -298,7 +298,7 @@ Full columns and constants are represented differently in memory. Functions usua
|
||||
Accepts any arguments, including `NULL` and does nothing. Always returns 0.
|
||||
The argument is internally still evaluated. Useful e.g. for benchmarks.
|
||||
|
||||
## sleep(seconds)
|
||||
## sleep
|
||||
|
||||
Used to introduce a delay or pause in the execution of a query. It is primarily used for testing and debugging purposes.
|
||||
|
||||
@ -310,7 +310,7 @@ sleep(seconds)
|
||||
|
||||
**Arguments**
|
||||
|
||||
- `seconds`: [Int](../../sql-reference/data-types/int-uint.md) The number of seconds to pause the query execution to a maximum of 3 seconds. It can be a floating-point value to specify fractional seconds.
|
||||
- `seconds`: [UInt*](../../sql-reference/data-types/int-uint.md) or [Float](../../sql-reference/data-types/float.md) The number of seconds to pause the query execution to a maximum of 3 seconds. It can be a floating-point value to specify fractional seconds.
|
||||
|
||||
**Returned value**
|
||||
|
||||
@ -360,7 +360,7 @@ sleepEachRow(seconds)
|
||||
|
||||
**Arguments**
|
||||
|
||||
- `seconds`: [Int](../../sql-reference/data-types/int-uint.md) The number of seconds to pause the query execution for each row in the result set to a maximum of 3 seconds. It can be a floating-point value to specify fractional seconds.
|
||||
- `seconds`: [UInt*](../../sql-reference/data-types/int-uint.md) or [Float*](../../sql-reference/data-types/float.md) The number of seconds to pause the query execution for each row in the result set to a maximum of 3 seconds. It can be a floating-point value to specify fractional seconds.
|
||||
|
||||
**Returned value**
|
||||
|
||||
|
@ -62,32 +62,17 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/// Get the name of the function.
|
||||
String getName() const override
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Do not sleep during query analysis.
|
||||
bool isSuitableForConstantFolding() const override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t getNumberOfArguments() const override
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
String getName() const override { return name; }
|
||||
bool isSuitableForConstantFolding() const override { return false; } /// Do not sleep during query analysis.
|
||||
size_t getNumberOfArguments() const override { return 1; }
|
||||
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return true; }
|
||||
|
||||
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
|
||||
{
|
||||
WhichDataType which(arguments[0]);
|
||||
|
||||
if (!which.isFloat()
|
||||
&& !which.isNativeUInt())
|
||||
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of argument of function {}, expected Float64",
|
||||
if (!which.isFloat() && !which.isNativeUInt())
|
||||
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of argument of function {}, expected UInt* or Float*",
|
||||
arguments[0]->getName(), getName());
|
||||
|
||||
return std::make_shared<DataTypeUInt8>();
|
||||
|
Loading…
Reference in New Issue
Block a user