mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Header in every stream: development [#CLICKHOUSE-2]
This commit is contained in:
parent
3204b9688c
commit
d02874bf54
@ -604,11 +604,12 @@ public:
|
|||||||
throw Exception("The argument of function " + getName() + " must be constant.", ErrorCodes::ILLEGAL_COLUMN);
|
throw Exception("The argument of function " + getName() + " must be constant.", ErrorCodes::ILLEGAL_COLUMN);
|
||||||
|
|
||||||
Float64 seconds = applyVisitor(FieldVisitorConvertToNumber<Float64>(), static_cast<const ColumnConst &>(*col).getField());
|
Float64 seconds = applyVisitor(FieldVisitorConvertToNumber<Float64>(), static_cast<const ColumnConst &>(*col).getField());
|
||||||
size_t size = col->size();
|
|
||||||
|
|
||||||
if (seconds < 0)
|
if (seconds < 0)
|
||||||
throw Exception("Cannot sleep negative amount of time (not implemented)", ErrorCodes::BAD_ARGUMENTS);
|
throw Exception("Cannot sleep negative amount of time (not implemented)", ErrorCodes::BAD_ARGUMENTS);
|
||||||
|
|
||||||
|
size_t size = col->size();
|
||||||
|
|
||||||
/// We do not sleep if the block is empty.
|
/// We do not sleep if the block is empty.
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
|
@ -65,6 +65,8 @@ public:
|
|||||||
|
|
||||||
bool isVariadic() const override { return true; }
|
bool isVariadic() const override { return true; }
|
||||||
size_t getNumberOfArguments() const override { return 0; }
|
size_t getNumberOfArguments() const override { return 0; }
|
||||||
|
bool useDefaultImplementationForConstants() const override { return true; }
|
||||||
|
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1, 2}; }
|
||||||
|
|
||||||
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
|
||||||
{
|
{
|
||||||
@ -189,7 +191,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void executeConst(Block & block, const ColumnNumbers & arguments, const size_t result)
|
void executeConst(Block & block, const ColumnNumbers & arguments, const size_t result)
|
||||||
{
|
{
|
||||||
/// Construct a block of full-size columns of size 1 and compute the function as usual.
|
/// Materialize the input column and compute the function as usual.
|
||||||
|
|
||||||
Block tmp_block;
|
Block tmp_block;
|
||||||
ColumnNumbers tmp_arguments;
|
ColumnNumbers tmp_arguments;
|
||||||
@ -209,9 +211,7 @@ private:
|
|||||||
|
|
||||||
execute(tmp_block, tmp_arguments, tmp_result);
|
execute(tmp_block, tmp_arguments, tmp_result);
|
||||||
|
|
||||||
block.getByPosition(result).column = block.getByPosition(result).type->createColumnConst(
|
block.getByPosition(result).column = tmp_block.getByPosition(tmp_result).column;
|
||||||
block.rows(),
|
|
||||||
(*tmp_block.getByPosition(tmp_result).column)[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -727,7 +727,7 @@ private:
|
|||||||
/// Different versions of the hash tables to implement the mapping.
|
/// Different versions of the hash tables to implement the mapping.
|
||||||
|
|
||||||
using NumToNum = HashMap<UInt64, UInt64, HashCRC32<UInt64>>;
|
using NumToNum = HashMap<UInt64, UInt64, HashCRC32<UInt64>>;
|
||||||
using NumToString = HashMap <UInt64, StringRef, HashCRC32 <UInt64 >>; /// Everywhere StringRef's with trailing zero.
|
using NumToString = HashMap <UInt64, StringRef, HashCRC32<UInt64>>; /// Everywhere StringRef's with trailing zero.
|
||||||
using StringToNum = HashMap<StringRef, UInt64, StringRefHash>;
|
using StringToNum = HashMap<StringRef, UInt64, StringRefHash>;
|
||||||
using StringToString = HashMap<StringRef, StringRef, StringRefHash>;
|
using StringToString = HashMap<StringRef, StringRef, StringRefHash>;
|
||||||
|
|
||||||
@ -740,7 +740,7 @@ private:
|
|||||||
|
|
||||||
Field const_default_value; /// Null, if not specified.
|
Field const_default_value; /// Null, if not specified.
|
||||||
|
|
||||||
bool initialized = false;
|
std::atomic<bool> initialized {false};
|
||||||
std::mutex mutex;
|
std::mutex mutex;
|
||||||
|
|
||||||
/// Can be called from different threads. It works only on the first call.
|
/// Can be called from different threads. It works only on the first call.
|
||||||
|
Loading…
Reference in New Issue
Block a user