mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
4e76629aaf
- lots of static_cast - add safe_cast - types adjustments - config - IStorage::read/watch - ... - some TODO's (to convert types in future) P.S. That was quite a journey... v2: fixes after rebase v3: fix conflicts after #42308 merged Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <Storages/IStorage.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
/* One block storage used for values table function
|
|
* It's structure is similar to IStorageSystemOneBlock
|
|
*/
|
|
class StorageValues final : public IStorage
|
|
{
|
|
public:
|
|
StorageValues(
|
|
const StorageID & table_id_, const ColumnsDescription & columns_, const Block & res_block_, const NamesAndTypesList & virtuals_ = {});
|
|
|
|
std::string getName() const override { return "Values"; }
|
|
|
|
Pipe read(
|
|
const Names & column_names,
|
|
const StorageSnapshotPtr & storage_snapshot,
|
|
SelectQueryInfo & query_info,
|
|
ContextPtr context,
|
|
QueryProcessingStage::Enum processed_stage,
|
|
size_t max_block_size,
|
|
size_t num_streams) override;
|
|
|
|
/// Why we may have virtual columns in the storage from a single block?
|
|
/// Because it used as tmp storage for pushing blocks into views, and some
|
|
/// views may contain virtual columns from original storage.
|
|
NamesAndTypesList getVirtuals() const override
|
|
{
|
|
return virtuals;
|
|
}
|
|
|
|
/// FIXME probably it should return false, but StorageValues is used in ExecutingInnerQueryFromViewTransform (whatever it is)
|
|
bool supportsTransactions() const override { return true; }
|
|
|
|
private:
|
|
Block res_block;
|
|
NamesAndTypesList virtuals;
|
|
};
|
|
|
|
}
|