2019-07-18 14:41:11 +00:00
|
|
|
#pragma once
|
2021-06-25 16:22:39 +00:00
|
|
|
#include <Storages/MergeTree/MergeTreeSelectProcessor.h>
|
2019-07-18 14:41:11 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/// Used to read data from single part with select query
|
2021-06-25 16:22:39 +00:00
|
|
|
/// in reverse order of primary key.
|
2019-07-18 14:41:11 +00:00
|
|
|
/// Cares about PREWHERE, virtual columns, indexes etc.
|
|
|
|
/// To read data from multiple parts, Storage (MergeTree) creates multiple such objects.
|
2021-06-25 16:22:39 +00:00
|
|
|
class MergeTreeReverseSelectProcessor : public MergeTreeSelectProcessor
|
2019-07-18 14:41:11 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-10-01 16:50:08 +00:00
|
|
|
MergeTreeReverseSelectProcessor(
|
2019-07-18 14:41:11 +00:00
|
|
|
const MergeTreeData & storage,
|
2020-06-16 14:25:08 +00:00
|
|
|
const StorageMetadataPtr & metadata_snapshot,
|
2019-07-18 14:41:11 +00:00
|
|
|
const MergeTreeData::DataPartPtr & owned_data_part,
|
|
|
|
UInt64 max_block_size_rows,
|
|
|
|
size_t preferred_block_size_bytes,
|
|
|
|
size_t preferred_max_column_in_block_size_bytes,
|
2020-03-09 02:55:28 +00:00
|
|
|
Names required_columns_,
|
2019-10-04 15:40:05 +00:00
|
|
|
MarkRanges mark_ranges,
|
2019-07-18 14:41:11 +00:00
|
|
|
bool use_uncompressed_cache,
|
|
|
|
const PrewhereInfoPtr & prewhere_info,
|
2021-06-25 14:49:28 +00:00
|
|
|
ExpressionActionsSettings actions_settings,
|
2019-07-18 14:41:11 +00:00
|
|
|
bool check_columns,
|
2019-12-18 15:54:45 +00:00
|
|
|
const MergeTreeReaderSettings & reader_settings,
|
2019-07-18 14:41:11 +00:00
|
|
|
const Names & virt_column_names = {},
|
2021-07-13 14:24:45 +00:00
|
|
|
bool has_limit_below_one_block_ = false,
|
2019-07-18 14:41:11 +00:00
|
|
|
bool quiet = false);
|
|
|
|
|
|
|
|
String getName() const override { return "MergeTreeReverse"; }
|
|
|
|
|
2021-06-25 16:22:39 +00:00
|
|
|
private:
|
2019-07-18 14:41:11 +00:00
|
|
|
bool getNewTask() override;
|
2019-10-01 16:50:08 +00:00
|
|
|
Chunk readFromPart() override;
|
2019-07-18 14:41:11 +00:00
|
|
|
|
2019-10-01 16:50:08 +00:00
|
|
|
Chunks chunks;
|
2020-05-30 21:57:37 +00:00
|
|
|
Poco::Logger * log = &Poco::Logger::get("MergeTreeReverseSelectProcessor");
|
2019-07-18 14:41:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|