diff --git a/dbms/src/DataStreams/IBlockInputStream.h b/dbms/src/DataStreams/IBlockInputStream.h index b7202f02dc9..20e27cc7080 100644 --- a/dbms/src/DataStreams/IBlockInputStream.h +++ b/dbms/src/DataStreams/IBlockInputStream.h @@ -25,6 +25,10 @@ using TableStructureReadLocksList = std::list; struct Progress; +namespace ErrorCodes +{ + extern const int OUTPUT_IS_NOT_SORTED; +} /** Коллбэк для отслеживания прогресса выполнения запроса. @@ -77,8 +81,10 @@ public: */ virtual String getID() const = 0; + /// If this stream generates data in order by some keys, return true. virtual bool isSortedOutput() const { return false; } - virtual const SortDescription & getSortDescription() const { throw std::logic_error( "has no SortDescription" ); } + /// In case of isSortedOutput, return corresponding SortDescription + virtual const SortDescription & getSortDescription() const { throw Exception("Output of " + getName() + " is not sorted", ErrorCodes::OUTPUT_IS_NOT_SORTED); } BlockInputStreams & getChildren() { return children; }