ClickHouse/src/Storages/StorageValues.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
C++
Raw Normal View History

2019-07-29 13:50:13 +00:00
#pragma once
#include <Storages/IStorage.h>
2019-07-30 12:15:02 +00:00
2019-07-29 13:50:13 +00:00
namespace DB
{
2019-07-31 14:12:05 +00:00
/* One block storage used for values table function
* It's structure is similar to IStorageSystemOneBlock
*/
class StorageValues final : public IStorage
2019-07-29 13:50:13 +00:00
{
public:
StorageValues(
const StorageID & table_id_, const ColumnsDescription & columns_, const Block & res_block_, const NamesAndTypesList & virtuals_ = {});
2019-07-29 13:50:13 +00:00
std::string getName() const override { return "Values"; }
2020-08-03 13:54:14 +00:00
Pipe read(
2019-07-29 16:20:17 +00:00
const Names & column_names,
const StorageSnapshotPtr & storage_snapshot,
SelectQueryInfo & query_info,
ContextPtr context,
2019-07-29 16:20:17 +00:00
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
size_t num_streams) override;
2019-07-29 13:50:13 +00:00
2020-04-29 12:15:23 +00:00
/// 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; }
bool parallelizeOutputAfterReading(ContextPtr) const override { return false; }
2019-07-29 13:50:13 +00:00
private:
Block res_block;
2020-04-29 12:15:23 +00:00
NamesAndTypesList virtuals;
2019-07-29 13:50:13 +00:00
};
2019-07-30 12:15:02 +00:00
2019-07-29 13:50:13 +00:00
}