See https://github.com/ClickHouse/ClickHouse/pull/13193
#include <Processors/Transforms/FinishSortingTransform.h>
namespace DB
{
namespace ErrorCodes
{
    extern const int LOGICAL_ERROR;
}
static bool isPrefix(const SortDescription & pref_descr, const SortDescription & descr)