ClickHouse/dbms/src/Storages/StorageGenerate.h

36 lines
909 B
C++
Raw Normal View History

2020-02-26 14:12:07 +00:00
#pragma once
#include <ext/shared_ptr_helper.h>
#include <Storages/IStorage.h>
namespace DB
{
/* Generates random data for given schema.
*/
class StorageGenerate : public ext::shared_ptr_helper<StorageGenerate>, public IStorage
{
friend struct ext::shared_ptr_helper<StorageGenerate>;
public:
std::string getName() const override { return "Generate"; }
Pipes read(
const Names & column_names,
const SelectQueryInfo & query_info,
const Context & context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
unsigned num_streams) override;
private:
UInt64 max_array_length = 10;
UInt64 max_string_length = 10;
UInt64 random_seed = 0;
protected:
StorageGenerate(const StorageID & table_id_, const ColumnsDescription & columns_,
2020-03-02 12:19:27 +00:00
UInt64 max_array_length, UInt64 max_string_length, UInt64 random_seed);
2020-02-26 14:12:07 +00:00
};
}