#pragma once #include #include #include #include #include #include #include namespace DB { class ReadFromSystemNumbersStep final : public SourceStepWithFilter { public: ReadFromSystemNumbersStep( const Names & column_names_, const SelectQueryInfo & query_info_, const StorageSnapshotPtr & storage_snapshot_, const ContextPtr & context_, StoragePtr storage_, size_t max_block_size_, size_t num_streams_); String getName() const override { return "ReadFromSystemNumbers"; } void initializePipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &) override; private: /// Fail fast if estimated number of rows to read exceeds the limit void checkLimits(size_t rows); Pipe makePipe(); const Names column_names; StoragePtr storage; ExpressionActionsPtr key_expression; size_t max_block_size; size_t num_streams; std::pair limit_length_and_offset; bool should_pushdown_limit; UInt64 query_info_limit; std::shared_ptr storage_limits; }; }