mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Update StorageGenerate.cpp
This commit is contained in:
parent
adcf1735d6
commit
678cc00d30
@ -40,7 +40,6 @@ void fillColumnWithRandomData(IColumn & column, const DataTypePtr type, UInt64 l
|
||||
UInt64 max_array_length, UInt64 max_string_length, pcg32 & generator, pcg64_fast & generator64)
|
||||
{
|
||||
TypeIndex idx = type->getTypeId();
|
||||
(void) max_string_length;
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
@ -237,7 +236,7 @@ void fillColumnWithRandomData(IColumn & column, const DataTypePtr type, UInt64 l
|
||||
case TypeIndex::FixedString:
|
||||
{
|
||||
auto & column_string = typeid_cast<ColumnFixedString &>(column);
|
||||
size_t len = column_string.sizeOfValueIfFixed();
|
||||
const size_t len = column_string.sizeOfValueIfFixed();
|
||||
auto & chars = column_string.getChars();
|
||||
|
||||
UInt64 num_chars = static_cast<UInt64>(len) * limit;
|
||||
@ -310,8 +309,8 @@ void fillColumnWithRandomData(IColumn & column, const DataTypePtr type, UInt64 l
|
||||
Int128 x = static_cast<Int128>(generator64()) << 64 | static_cast<Int128>(generator64());
|
||||
data[i] = x;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TypeIndex::UUID:
|
||||
{
|
||||
auto & data = typeid_cast<ColumnVector<UInt128> &>(column).getData();
|
||||
@ -323,8 +322,8 @@ void fillColumnWithRandomData(IColumn & column, const DataTypePtr type, UInt64 l
|
||||
auto x = UInt128(a, b);
|
||||
data[i] = x;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TypeIndex::Array:
|
||||
{
|
||||
auto & column_array = typeid_cast<ColumnArray &>(column);
|
||||
@ -373,7 +372,7 @@ void fillColumnWithRandomData(IColumn & column, const DataTypePtr type, UInt64 l
|
||||
null_map.resize(limit);
|
||||
for (UInt64 i = 0; i < limit; ++i)
|
||||
{
|
||||
null_map[i] = generator() < 1024;
|
||||
null_map[i] = generator() < 1024; /// No real motivation for this.
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user