diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-02-01 15:05:25 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-02-01 15:05:25 +0300 |
commit | acce22d4812c919616875de449eb6eb69006593a (patch) | |
tree | 038c55caa2d5ea35c9e8506354ef045e0ccd37bd | |
parent | 99bf72df7c096ea5a2b9015d3bfe4b84fc02c469 (diff) | |
download | ydb-acce22d4812c919616875de449eb6eb69006593a.tar.gz |
WideTop[Sort] fix key width.
-rw-r--r-- | ydb/library/yql/minikql/comp_nodes/mkql_wide_top_sort.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_wide_top_sort.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_wide_top_sort.cpp index 6d45e6e83c..70d8319634 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_wide_top_sort.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_wide_top_sort.cpp @@ -45,8 +45,8 @@ private: std::for_each(Indexes.cbegin(), Indexes.cend(), [&](ui32 index) { Fields[index] = static_cast<NUdf::TUnboxedValue*>(ptr++); }); } public: - TState(TMemoryUsageInfo* memInfo, ui64 count, const bool* directons, const TCompareFunc& compare, const std::vector<ui32>& indexes) - : TBase(memInfo), Count(count), Indexes(indexes), Directions(directons, directons + Indexes.size()) + TState(TMemoryUsageInfo* memInfo, ui64 count, const bool* directons, size_t keyWidth, const TCompareFunc& compare, const std::vector<ui32>& indexes) + : TBase(memInfo), Count(count), Indexes(indexes), Directions(directons, directons + keyWidth) , LessFunc(std::bind(std::less<int>(), std::bind(compare, Directions.data(), std::placeholders::_1, std::placeholders::_2), 0)) , Storage(GetStorageSize() * Indexes.size()), Free(GetStorageSize(), nullptr), Fields(Indexes.size(), nullptr) { @@ -384,9 +384,9 @@ public: private: void MakeState(TComputationContext& ctx, NUdf::TUnboxedValue& state, ui64 count, const bool* directions) const { #ifdef MKQL_DISABLE_CODEGEN - state = ctx.HolderFactory.Create<TState>(count, directions, TMyValueCompare(KeyTypes), Indexes); + state = ctx.HolderFactory.Create<TState>(count, directions, Directions.size(), TMyValueCompare(KeyTypes), Indexes); #else - state = ctx.HolderFactory.Create<TState>(count, directions, ctx.ExecuteLLVM && Compare ? TCompareFunc(Compare) : TCompareFunc(TMyValueCompare(KeyTypes)), Indexes); + state = ctx.HolderFactory.Create<TState>(count, directions, Directions.size(), ctx.ExecuteLLVM && Compare ? TCompareFunc(Compare) : TCompareFunc(TMyValueCompare(KeyTypes)), Indexes); #endif } |