diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-06-19 19:01:37 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-06-19 19:01:37 +0300 |
commit | f663d5b764a0e55fbade4ca35c6df11ef6b5b74f (patch) | |
tree | e4e887779d18920703d3af518c31cdb36d647afc | |
parent | 982a56b8b9f1873e02c01c593ea5dcc87f808433 (diff) | |
download | ydb-f663d5b764a0e55fbade4ca35c6df11ef6b5b74f.tar.gz |
YQL-15941 Fix warnings and build with no codegen.
36 files changed, 144 insertions, 201 deletions
diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp index cf6216d949..9f538ec7a0 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp @@ -22,7 +22,7 @@ public: : Alloc(__LOCATION__) , MemInfo("Apply") , HolderFactory(Alloc.Ref(), MemInfo) - , ValueBuilder(HolderFactory, NUdf::EValidatePolicy::Exception) + , ValueBuilder(HolderFactory, NUdf::EValidatePolicy::Exception) , Args(argsCount) { Alloc.Release(); @@ -46,7 +46,7 @@ public: : Parent_(parent) , Callable_(callable) , ArgsValuesDescr_(ToValueDescr(argsTypes)) - , Kernel_(ConvertToInputTypes(argsTypes), ConvertToOutputType(returnType), [parent, this](arrow::compute::KernelContext* ctx, const arrow::compute::ExecBatch& batch, arrow::Datum* res) { + , Kernel_(ConvertToInputTypes(argsTypes), ConvertToOutputType(returnType), [this](arrow::compute::KernelContext* ctx, const arrow::compute::ExecBatch& batch, arrow::Datum* res) { auto& state = dynamic_cast<TKernelState&>(*ctx->state()); auto guard = Guard(state.Alloc); Y_ENSURE(batch.values.size() == state.Args.size()); @@ -106,9 +106,9 @@ public: if (UsedArgs != CallableType->GetArgumentsCount()) { return {}; } - + std::shared_ptr<arrow::DataType> t; - if (!CallableType->GetReturnType()->IsBlock() || + if (!CallableType->GetReturnType()->IsBlock() || !ConvertArrowType(AS_TYPE(TBlockType, CallableType->GetReturnType())->GetItemType(), t)) { return {}; } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp index 1992d6e602..b6ee6e8ad1 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp @@ -496,7 +496,7 @@ private: bool HasValues_ = false; TVector<char> AggStates_; - TState(TMemoryUsageInfo* memInfo, size_t width, std::optional<ui32> filterColumn, const TVector<TAggParams<IBlockAggregatorCombineAll>>& params, TComputationContext& ctx) + TState(TMemoryUsageInfo* memInfo, size_t width, std::optional<ui32>, const TVector<TAggParams<IBlockAggregatorCombineAll>>& params, TComputationContext& ctx) : TComputationValue(memInfo) , Values_(width) , ValuePointers_(width) @@ -649,8 +649,8 @@ public: , OutputWidth_(keys.size() + aggsParams.size() + 1) , Keys_(keys) , MaxBlockLen_(maxBlockLen) - , KeyLength_(keyLength) , AggsParams_(std::move(aggsParams)) + , KeyLength_(keyLength) , StreamIndex_(streamIndex) , Streams_(std::move(streams)) { @@ -847,7 +847,7 @@ private: typename TFixedMapImpl::iterator HashFixedMapIt_; TPagedArena Arena_; - TState(TMemoryUsageInfo* memInfo, ui32 keyLength, size_t width, std::optional<ui32> filterColumn, const TVector<TAggParams<TAggregator>>& params, + TState(TMemoryUsageInfo* memInfo, ui32 keyLength, size_t width, std::optional<ui32>, const TVector<TAggParams<TAggregator>>& params, const TVector<TVector<ui32>>& streams, const std::vector<TKeyParams>& keys, size_t maxBlockLen, TComputationContext& ctx) : TBase(memInfo) , Values_(width) @@ -869,7 +869,7 @@ private: if constexpr (Many) { TotalStateSize_ += streams.size(); - } + } for (const auto& p : params) { Aggs_.emplace_back(p.Prepared_->Make(ctx)); @@ -889,7 +889,7 @@ private: } else { HashMap_ = std::make_unique<TDynamicHashMapImpl<TKey, std::equal_to<TKey>, std::hash<TKey>, TMKQLAllocator<char>>>(TotalStateSize_, hasher, equal); } - } + } } void PrepareAggBuilders(size_t maxBlockSize) { @@ -1452,7 +1452,7 @@ IComputationNode* WrapBlockCombineAll(TCallable& callable, const TComputationNod auto aggsVal = AS_VALUE(TTupleLiteral, callable.GetInput(2)); TVector<TAggParams<IBlockAggregatorCombineAll>> aggsParams; - ui32 totalStateSize = FillAggParams<IBlockAggregatorCombineAll>(aggsVal, tupleType, filterColumn, aggsParams, ctx.Env, false, false, returnWideComponents, 0); + FillAggParams<IBlockAggregatorCombineAll>(aggsVal, tupleType, filterColumn, aggsParams, ctx.Env, false, false, returnWideComponents, 0); return new TBlockCombineAllWrapper(ctx.Mutables, wideFlow, filterColumn, tupleType->GetElementsCount(), std::move(aggsParams)); } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_minmax.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_minmax.cpp index 923236b999..9fe7c1a9be 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_minmax.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_minmax.cpp @@ -31,7 +31,7 @@ inline bool AggLess(T a, T b) { } } return a < b; -} +} template <bool IsMin, typename T> inline T UpdateMinMax(T x, T y) { @@ -239,10 +239,10 @@ public: } } else { stateItem = Converter_->MakeItem(typedState); - + const auto& array = datum.array(); auto len = array->length; - + const ui8* filterBitmap = nullptr; if (filtered) { const auto& filterDatum = TArrowBlock::From(columns[*FilterColumn_]).GetDatum(); @@ -251,7 +251,7 @@ public: filterBitmap = filterArray->template GetValues<uint8_t>(1); } auto& comparator = *Compare_; - for (size_t i = 0; i < len; ++i) { + for (auto i = 0; i < len; ++i) { TBlockItem curr = currReader->GetItem(*array, i); if (curr && (!filterBitmap || filterBitmap[i])) { bool changed = false; @@ -912,7 +912,7 @@ template <typename TTag, bool IsMin> std::unique_ptr<typename TTag::TPreparedAggregator> PrepareMinMax(TTupleType* tupleType, std::optional<ui32> filterColumn, ui32 argColumn) { auto blockType = AS_TYPE(TBlockType, tupleType->GetElementType(argColumn)); const bool isScalar = blockType->GetShape() == TBlockType::EShape::Scalar; - auto argType = blockType->GetItemType(); + auto argType = blockType->GetItemType(); bool isOptional; auto unpacked = UnpackOptional(argType, isOptional); @@ -1000,6 +1000,6 @@ std::unique_ptr<IBlockAggregatorFactory> MakeBlockMinFactory() { std::unique_ptr<IBlockAggregatorFactory> MakeBlockMaxFactory() { return std::make_unique<TBlockMinMaxFactory<false>>(); } - + } } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_some.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_some.cpp index 58cedbfaeb..b82e311b88 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_some.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg_some.cpp @@ -94,7 +94,7 @@ public: } else { const auto& array = datum.array(); auto len = array->length; - + const ui8* filterBitmap = nullptr; if (filtered) { const auto& filterDatum = TArrowBlock::From(columns[*FilterColumn_]).GetDatum(); @@ -103,7 +103,7 @@ public: filterBitmap = filterArray->template GetValues<uint8_t>(1); } - for (size_t i = 0; i < len; ++i) { + for (auto i = 0; i < len; ++i) { TBlockItem curr = Reader_->GetItem(*array, i); if (curr && (!filterBitmap || filterBitmap[i])) { typedState = Converter_->MakeValue(curr, Ctx_.HolderFactory); @@ -242,10 +242,8 @@ private: template <typename TTag> std::unique_ptr<typename TTag::TPreparedAggregator> PrepareSome(TTupleType* tupleType, std::optional<ui32> filterColumn, ui32 argColumn) { - auto blockType = AS_TYPE(TBlockType, tupleType->GetElementType(argColumn)); - const bool isScalar = blockType->GetShape() == TBlockType::EShape::Scalar; - auto argType = blockType->GetItemType(); - + const auto blockType = AS_TYPE(TBlockType, tupleType->GetElementType(argColumn)); + const auto argType = blockType->GetItemType(); return std::make_unique<TPreparedSomeBlockGenericAggregator<TTag>>(argType, filterColumn, argColumn); } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_compress.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_compress.cpp index f0c5108e41..901d3cf50b 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_compress.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_compress.cpp @@ -193,7 +193,7 @@ public: // all entries are filtered continue; } - bool copyAsIs = !s.HaveBlocks_ || popCount == bitmap->length; + bool copyAsIs = !s.HaveBlocks_ || popCount == ui64(bitmap->length); if (copyAsIs) { // client is not interested in any block columns or there is nothing to filter s.OutputPos_ = popCount; @@ -205,7 +205,7 @@ public: for (size_t i = 0; i < Width_; ++i) { if (s.Builders_[i] || i == BitmapIndex_) { s.Arrays_[i] = TArrowBlock::From(s.InputValues_[i]).GetDatum().array(); - Y_VERIFY(s.Arrays_[i]->length == s.InputSize_); + Y_VERIFY(ui64(s.Arrays_[i]->length) == s.InputSize_); } } } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_if.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_if.cpp index 544f67e669..d12077bb59 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_if.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_if.cpp @@ -131,9 +131,7 @@ template<bool ThenIsScalar, bool ElseIsScalar> class TIfBlockExec { public: explicit TIfBlockExec(TType* type) - : Type(type) - , ThenReader(MakeBlockReader(TTypeInfoHelper(), type)) - , ElseReader(MakeBlockReader(TTypeInfoHelper(), type)) + : ThenReader(MakeBlockReader(TTypeInfoHelper(), type)), ElseReader(MakeBlockReader(TTypeInfoHelper(), type)), Type(type) { } @@ -175,8 +173,6 @@ public: } ui64 mask = -ui64(predValues[i]); - - TBlockItem result; ui64 low = (thenItem.Low() & mask) | (elseItem.Low() & ~mask); ui64 high = (thenItem.High() & mask) | (elseItem.High() & ~mask); builder->Add(TBlockItem{low, high}); @@ -239,7 +235,7 @@ IComputationNode* WrapBlockIf(TCallable& callable, const TComputationNodeFactory } TVector<IComputationNode*> argsNodes = { predCompute, thenCompute, elseCompute }; - + std::shared_ptr<arrow::compute::ScalarKernel> kernel; if (thenIsScalar && elseIsScalar) { kernel = MakeBlockIfKernel<true, true>(argsTypes, thenType); diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.cpp index b7df034db5..70ba311261 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.cpp @@ -67,7 +67,7 @@ arrow::Datum ConvertScalar(TType* type, const NUdf::TUnboxedValuePod& value, arr case NUdf::EDataSlot::Double: return arrow::Datum(static_cast<double>(value.Get<double>())); case NUdf::EDataSlot::String: - case NUdf::EDataSlot::Utf8: + case NUdf::EDataSlot::Utf8: case NUdf::EDataSlot::Yson: case NUdf::EDataSlot::Json: { const auto& str = value.AsStringRef(); @@ -197,7 +197,7 @@ TBlockFuncNode::TState& TBlockFuncNode::GetState(TComputationContext& ctx) const return *static_cast<TState*>(result.AsBoxed().Get()); } -std::unique_ptr<IArrowKernelComputationNode> TBlockFuncNode::PrepareArrowKernelComputationNode(TComputationContext& ctx) const { +std::unique_ptr<IArrowKernelComputationNode> TBlockFuncNode::PrepareArrowKernelComputationNode(TComputationContext&) const { return std::make_unique<TArrowNode>(this); } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.h b/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.h index 727e7343bb..a48b3c2a62 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.h +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_impl.h @@ -103,7 +103,7 @@ private: TVector<TDeque<std::shared_ptr<arrow::ArrayData>>> Arrays; ui64 Count = 0; - TState(TMemoryUsageInfo* memInfo, size_t width, NUdf::TUnboxedValue*const* values, TComputationContext& ctx) + TState(TMemoryUsageInfo* memInfo, size_t width, NUdf::TUnboxedValue*const* values, TComputationContext&) : TBase(memInfo) , Values(width) , ValuePointers(width) @@ -126,7 +126,6 @@ private: EFetchResult FetchValues(TComputationContext& ctx, NUdf::TUnboxedValue*const* output) const final { TState& s = GetState(ctx, output); - const TDerived& child = static_cast<const TDerived&>(*this); while (s.Count == 0) { auto result = static_cast<const TDerived*>(this)->DoCalculate(s.ChildState, ctx, s.ValuePointers.data()); if (result != EFetchResult::One) { @@ -165,7 +164,7 @@ private: continue; } - MKQL_ENSURE(arr.front()->length <= s.Count, "Unexpected array length at column #" << i); + MKQL_ENSURE(ui64(arr.front()->length) <= s.Count, "Unexpected array length at column #" << i); sliceSize = std::min<ui64>(sliceSize, arr.front()->length); } @@ -179,7 +178,7 @@ private: } auto& array = s.Arrays[i].front(); - if (array->length == sliceSize) { + if (ui64(array->length) == sliceSize) { *(output[i]) = ctx.HolderFactory.CreateArrowBlock(std::move(array)); s.Arrays[i].pop_front(); } else { diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_just.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_just.cpp index 65b0273e0c..2c9473c5f4 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_just.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_just.cpp @@ -18,7 +18,7 @@ public: : ReturnArrowType(returnArrowType) {} - arrow::Status Exec(arrow::compute::KernelContext* ctx, const arrow::compute::ExecBatch& batch, arrow::Datum* res) const { + arrow::Status Exec(arrow::compute::KernelContext*, const arrow::compute::ExecBatch& batch, arrow::Datum* res) const { arrow::Datum inputDatum = batch.values[0]; if (Trivial) { *res = inputDatum; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_top.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_top.cpp index 6891e5d930..10d1873294 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_block_top.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_top.cpp @@ -124,12 +124,12 @@ public: auto datum = TArrowBlock::From(s.Values_[i]).GetDatum(); arrayIndicies[i] = MakeChunkedArrayIndex(datum); } - } - + } + TBlockLess cmp(KeyIndicies_, s, arrayIndicies); NYql::FastNthElement(blockIndicies->begin(), blockIndicies->begin() + s.Count_, blockIndicies->end(), cmp); } - + // copy all to builders s.AddTop(Columns_, blockIndicies, blockLen); if (s.BuilderLength_ + s.Count_ > s.BuilderMaxLength_) { @@ -262,7 +262,7 @@ private: } } - void CompressBuilders(bool sort, const TVector<TBlockType*>& columns, const TVector<ui32>& keyIndicies, TComputationContext& ctx) { + void CompressBuilders(bool sort, const TVector<TBlockType*>& columns, const TVector<ui32>& keyIndicies, TComputationContext&) { Y_VERIFY(ScalarsFilled_); TVector<TChunkedArrayIndex> arrayIndicies(columns.size()); TVector<arrow::Datum> tmpDatums(columns.size()); @@ -514,7 +514,7 @@ IComputationNode* WrapTopOrSort(TCallable& callable, const TComputationNodeFacto MKQL_ENSURE(countType->GetSchemeType() == NUdf::TDataType<ui64>::Id, "Expected ui64"); count = LocateNode(ctx.NodeLocator, callable, 1); } - + TVector<IComputationNode*> directions; TVector<ui32> keyIndicies; for (ui32 i = 2; i < inputsWithCount; i += 2) { diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_blocks.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_blocks.cpp index b9693e9cc2..1b6cde3f89 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_blocks.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_blocks.cpp @@ -204,7 +204,7 @@ private: if (Arrays_.empty()) { return {}; } - if (Index_ < Arrays_.front()->length) { + if (Index_ < ui64(Arrays_.front()->length)) { break; } Index_ = 0; @@ -348,7 +348,7 @@ public: class TArrowNode : public IArrowKernelComputationNode { public: TArrowNode(const arrow::Datum& datum) - : Kernel_({}, datum.scalar()->type, [datum](arrow::compute::KernelContext* ctx, const arrow::compute::ExecBatch& batch, arrow::Datum* res) { + : Kernel_({}, datum.scalar()->type, [datum](arrow::compute::KernelContext*, const arrow::compute::ExecBatch&, arrow::Datum* res) { *res = datum; return arrow::Status::OK(); }) diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_chopper.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_chopper.cpp index 644b8f0c93..51eef29dd8 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_chopper.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_chopper.cpp @@ -330,11 +330,9 @@ private: public: using TBase = TComputationValue<TSubStream>; - TSubStream(TMemoryUsageInfo* memInfo, const TStatePtr& state, const NUdf::TUnboxedValue& stream, IComputationExternalNode* itemArg, IComputationNode* key, IComputationExternalNode* keyArg, IComputationNode* chop, TComputationContext& ctx) + TSubStream(TMemoryUsageInfo* memInfo, const TStatePtr& state, const NUdf::TUnboxedValue& stream, IComputationExternalNode* itemArg, IComputationNode* chop, TComputationContext& ctx) : TBase(memInfo), State(state), Stream(stream) , ItemArg(itemArg) - , Key(key) - , KeyArg(keyArg) , Chop(chop) , Ctx(ctx) {} @@ -371,8 +369,6 @@ private: const NUdf::TUnboxedValue Stream; IComputationExternalNode *const ItemArg; - IComputationNode *const Key; - IComputationExternalNode *const KeyArg; IComputationNode *const Chop; TComputationContext& Ctx; @@ -381,7 +377,7 @@ private: class TMainStream : public TComputationValue<TMainStream> { public: TMainStream(TMemoryUsageInfo* memInfo, TStatePtr&& state, NUdf::TUnboxedValue&& stream, const IComputationExternalNode *itemArg, const IComputationNode *key, const IComputationExternalNode *keyArg, const IComputationNode *chop, const IComputationExternalNode *input, const IComputationNode *output, TComputationContext& ctx) - : TComputationValue(memInfo), State(std::move(state)), ItemArg(itemArg), Key(key), KeyArg(keyArg), Chop(chop), Input(input), Output(output), InputStream(std::move(stream)), Ctx(ctx) + : TComputationValue(memInfo), State(std::move(state)), ItemArg(itemArg), Key(key), Chop(chop), KeyArg(keyArg), Input(input), Output(output), InputStream(std::move(stream)), Ctx(ctx) {} private: NUdf::EFetchStatus Fetch(NUdf::TUnboxedValue& result) override { @@ -507,7 +503,7 @@ public: Input->SetValue(ctx, ctx.HolderFactory.Create<TCodegenInput>(InputPtr, stream, &ctx, sharedState)); else #endif - Input->SetValue(ctx, ctx.HolderFactory.Create<TSubStream>(sharedState, stream, ItemArg, Key, KeyArg, Chop, ctx)); + Input->SetValue(ctx, ctx.HolderFactory.Create<TSubStream>(sharedState, stream, ItemArg, Chop, ctx)); #ifndef MKQL_DISABLE_CODEGEN if (ctx.ExecuteLLVM && OutputPtr) diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_combine.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_combine.cpp index 7291a7d50d..0be56991bd 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_combine.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_combine.cpp @@ -75,7 +75,6 @@ class TState: public TComputationValue<TState> { THashFunc, TEqualsFunc, TMKQLAllocator<std::pair<const NUdf::TUnboxedValuePod, NUdf::TUnboxedValuePod>>>; public: - using TLLVMBase = TLLVMFieldsStructure<TBase>; TState(TMemoryUsageInfo* memInfo, const THashFunc& hash, const TEqualsFunc& equal) : TBase(memInfo), States(0, hash, equal) { States.max_load_factor(1.2f); @@ -123,9 +122,9 @@ private: }; #ifndef MKQL_DISABLE_CODEGEN -class TLLVMFieldsStructureState: public TState::TLLVMBase { +class TLLVMFieldsStructureState: public TLLVMFieldsStructure<TComputationValue<TState>> { private: - using TBase = typename TState::TLLVMBase; + using TBase = TLLVMFieldsStructure<TComputationValue<TState>>; llvm::PointerType* StructPtrType; llvm::IntegerType* StatusType; protected: diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_filter.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_filter.cpp index b852475ec6..f44420c7ba 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_filter.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_filter.cpp @@ -645,9 +645,10 @@ private: }; static constexpr size_t UseOnStack = 1ULL << 8ULL; +#ifndef MKQL_DISABLE_CODEGEN ui64* MyAlloc(const ui64 size) { return TMKQLAllocator<ui64>::allocate(size); } void MyFree(const ui64 *const ptr, const ui64 size) noexcept { TMKQLAllocator<ui64>::deallocate(ptr, size); } - +#endif class TListFilterWrapper : public TBothWaysCodegeneratorNode<TListFilterWrapper>, private TBaseFilterWrapper<false> { typedef TBaseFilterWrapper<false> TBaseWrapper; @@ -696,7 +697,6 @@ public: NUdf::TUnboxedValue* items = nullptr; const auto result = ctx.HolderFactory.CreateDirectArrayHolder(count, items); for (auto p = mask; count; ++p) { - const auto cb = count; auto e = elements; elements += 64ULL; for (auto bits = *p; bits; bits >>= 1ULL) { @@ -1060,7 +1060,6 @@ public: NUdf::TUnboxedValue* items = nullptr; const auto result = ctx.HolderFactory.CreateDirectArrayHolder(count, items); for (auto p = mask; count; ++p) { - const auto cb = count; auto e = elements; elements += 64ULL; for (auto bits = *p; bits; bits >>= 1ULL) { diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_flatmap.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_flatmap.cpp index 1ddeee2a77..c9a327237b 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_flatmap.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_flatmap.cpp @@ -1386,6 +1386,7 @@ private: #endif }; +#ifndef MKQL_DISABLE_CODEGEN NUdf::TUnboxedValuePod* MyArrayAlloc(const ui64 size) { return TMKQLAllocator<NUdf::TUnboxedValuePod>::allocate(size); } @@ -1393,7 +1394,7 @@ NUdf::TUnboxedValuePod* MyArrayAlloc(const ui64 size) { void MyArrayFree(const NUdf::TUnboxedValuePod *const ptr, const ui64 size) noexcept { TMKQLAllocator<NUdf::TUnboxedValuePod>::deallocate(ptr, size); } - +#endif template <bool IsMultiRowPerItem, bool ResultContainerOpt> class TListFlatMapWrapper : public TBothWaysCodegeneratorNode<TListFlatMapWrapper<IsMultiRowPerItem, ResultContainerOpt>>, private TBaseFlatMapWrapper<false, IsMultiRowPerItem, ResultContainerOpt> { diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_fromstring.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_fromstring.cpp index bb9440286a..c95e0db5a4 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_fromstring.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_fromstring.cpp @@ -265,7 +265,6 @@ private: } [[noreturn]] static void Throw(const NUdf::TUnboxedValuePod data, NUdf::EDataSlot slot) { - const auto& ref = data.AsStringRef(); ThrowConvertError(data.AsStringRef(), NUdf::GetDataTypeInfo(slot).Name); } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp index d1868f4e87..f5c4a38f0d 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp @@ -457,8 +457,6 @@ TGraceJoinPacker::TGraceJoinPacker(const std::vector<TType *> & columnTypes, con ui64 keyIntColumnsNum = std::count_if(ColumnsPackInfo.begin(), ColumnsPackInfo.end(), [](TColumnDataPackInfo a) { return (a.IsKeyColumn && !a.IsString && !a.IsPgType);}); ui64 keyIColumnsNum = std::count_if(ColumnsPackInfo.begin(), ColumnsPackInfo.end(), [](TColumnDataPackInfo a) { return (a.IsKeyColumn && a.IsIType);}); ui64 keyStrColumnsNum = nKeyColumns - keyIntColumnsNum - keyIColumnsNum; - ui64 dataIntColumnsNum = totalIntColumnsNum - keyIntColumnsNum; - ui64 dataStrColumnsNum = totalStrColumnsNum - keyStrColumnsNum; TotalColumnsNum = nColumns; TotalIntColumnsNum = totalIntColumnsNum; @@ -542,7 +540,7 @@ TGraceJoinPacker::TGraceJoinPacker(const std::vector<TType *> & columnTypes, con PackedKeyIntColumnsNum = (keyIntOffset + sizeof(ui64) - 1 ) / sizeof(ui64) - NullsBitmapSize; PackedDataIntColumnsNum = (currIntOffset + sizeof(ui64) - 1) / sizeof(ui64) - PackedKeyIntColumnsNum - NullsBitmapSize; - + GraceJoin::TColTypeInterface * cti_p = nullptr; if (TotalIColumnsNum > 0 ) { @@ -550,7 +548,7 @@ TGraceJoinPacker::TGraceJoinPacker(const std::vector<TType *> & columnTypes, con } TablePtr = std::make_unique<GraceJoin::TTable>( - PackedKeyIntColumnsNum, KeyStrColumnsNum, PackedDataIntColumnsNum, + PackedKeyIntColumnsNum, KeyStrColumnsNum, PackedDataIntColumnsNum, DataStrColumnsNum, KeyIColumnsNum, DataIColumnsNum, NullsBitmapSize, cti_p, IsAny ); } @@ -566,7 +564,13 @@ public: const std::vector<ui32>& leftRenames, const std::vector<ui32>& rightRenames, const std::vector<TType*>& leftColumnsTypes, const std::vector<TType*>& rightColumnsTypes, const THolderFactory & holderFactory) : TBase(memInfo) - , LeftPacker(std::make_unique<TGraceJoinPacker>(leftColumnsTypes, leftKeyColumns, holderFactory, (anyJoinSettings == EAnyJoinSettings::Left || anyJoinSettings == EAnyJoinSettings::Both))) + , FlowLeft(flowLeft) + , FlowRight(flowRight) + , JoinKind(joinKind) + , LeftKeyColumns(leftKeyColumns) + , RightKeyColumns(rightKeyColumns) + , LeftRenames(leftRenames) + , RightRenames(rightRenames) , LeftPacker(std::make_unique<TGraceJoinPacker>(leftColumnsTypes, leftKeyColumns, holderFactory, (anyJoinSettings == EAnyJoinSettings::Left || anyJoinSettings == EAnyJoinSettings::Both))) , RightPacker(std::make_unique<TGraceJoinPacker>(rightColumnsTypes, rightKeyColumns, holderFactory, (anyJoinSettings == EAnyJoinSettings::Right || anyJoinSettings == EAnyJoinSettings::Both))) , JoinedTablePtr(std::make_unique<GraceJoin::TTable>()) , JoinCompleted(std::make_unique<bool>(false)) @@ -574,14 +578,6 @@ public: , HaveMoreLeftRows(std::make_unique<bool>(true)) , HaveMoreRightRows(std::make_unique<bool>(true)) , JoinedTuple(std::make_unique<std::vector<NUdf::TUnboxedValue*>>() ) - , FlowLeft(flowLeft) - , FlowRight(flowRight) - , JoinKind(joinKind) - , AnyJoinSettings_(anyJoinSettings) - , LeftKeyColumns(leftKeyColumns) - , RightKeyColumns(rightKeyColumns) - , LeftRenames(leftRenames) - , RightRenames(rightRenames) { if (JoinKind == EJoinKind::Full || JoinKind == EJoinKind::Exclusion ) { LeftPacker->BatchSize = std::numeric_limits<ui64>::max(); @@ -593,7 +589,6 @@ private: IComputationWideFlowNode* const FlowRight; const EJoinKind JoinKind; - const EAnyJoinSettings AnyJoinSettings_; const std::vector<ui32> LeftKeyColumns; const std::vector<ui32> RightKeyColumns; const std::vector<ui32> LeftRenames; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp index a32ad40c9e..6a3844e355 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp @@ -31,7 +31,7 @@ void TTable::AddTuple( ui64 * intColumns, char ** stringColumns, ui32 * strings } } - + ui64 totalBytesForStrings = 0; ui64 totalIntsForStrings = 0; @@ -128,7 +128,7 @@ void TTable::AddTuple( ui64 * intColumns, char ** stringColumns, ui32 * strings stringsOffsets.push_back(offset); // Adding offset to tuple in keyIntVals vector stringsOffsets.push_back(stringVals.size()); // Adding offset to string values - + // Adding strings sizes for keys and data if ( NumberOfStringColumns ) { stringsOffsets.insert( stringsOffsets.end(), stringsSizes, stringsSizes+NumberOfStringColumns ); @@ -155,7 +155,7 @@ void TTable::AddTuple( ui64 * intColumns, char ** stringColumns, ui32 * strings // Adding strings values for data columns char ** dataStringsColumns = stringColumns + NumberOfKeyStringColumns; ui32 * dataStringsSizes = stringsSizes + NumberOfKeyStringColumns; - + for( ui64 i = 0; i < NumberOfDataStringColumns; i++) { ui32 currStringSize = *(dataStringsSizes + i); stringVals.insert(stringVals.end(), *(dataStringsColumns + i), *(dataStringsColumns + i) + currStringSize); @@ -180,7 +180,7 @@ void TTable::ResetIterator() { TotalUnpacked = 0; } -// Checks if there are more tuples and sets bucketId and tupleId to next valid. +// Checks if there are more tuples and sets bucketId and tupleId to next valid. inline bool HasMoreTuples(std::vector<TTableBucket> & tableBuckets, ui64 & bucketId, ui64 & tupleId ) { if (bucketId >= tableBuckets.size()) return false; @@ -192,12 +192,12 @@ inline bool HasMoreTuples(std::vector<TTableBucket> & tableBuckets, ui64 & bucke if (bucketId == tableBuckets.size()) { return false; } - + while( tableBuckets[bucketId].TuplesNum == 0 ) { bucketId ++; if (bucketId == tableBuckets.size()) { return false; - } + } } } @@ -224,7 +224,7 @@ inline bool HasBitSet( ui64 * buf, ui64 Nbits ) { if (*buf++) return true; Nbits -= sizeof(ui64)*8; } - return ((*buf) << (sizeof(ui64) * 8 - Nbits)); + return ((*buf) << (sizeof(ui64) * 8 - Nbits)); } @@ -233,8 +233,6 @@ inline bool CompareIColumns( const ui32* stringSizes1, const char * vals1, TColTypeInterface * colInterfaces, ui64 nStringColumns, ui64 nIColumns) { ui32 currOffset1 = 0; ui32 currOffset2 = 0; - char * currVal1 = 0; - char * currVal2 = 0; ui32 currSize1 = 0; ui32 currSize2 = 0; NYql::NUdf::TUnboxedValue val1, val2; @@ -247,7 +245,7 @@ inline bool CompareIColumns( const ui32* stringSizes1, const char * vals1, currOffset2 += currSize2; } for (ui32 i = 0; i < nIColumns; i ++) { - + currSize1 = *(stringSizes1 + nStringColumns + i ); currSize2 = *(stringSizes2 + nStringColumns + i ); str1 = TStringBuf(vals1 + currOffset1, currSize1); @@ -297,7 +295,7 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef if ( hasMoreLeftTuples ) LeftTableBatch_ = true; - + if( hasMoreRightTuples ) RightTableBatch_ = true; @@ -306,21 +304,16 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef JoinKind = joinKind; - + IsTableJoined = true; if (joinKind == EJoinKind::Cross) return; if ( JoinKind == EJoinKind::Right || JoinKind == EJoinKind::RightOnly || JoinKind == EJoinKind::RightSemi ) { std::swap(JoinTable1, JoinTable2); - } - + } ui64 tuplesFound = 0; - ui64 leftIdsMatch = 0; - ui64 rightIdsMatch = 0; - ui64 t2AnySkipped = 0; - ui64 t1AnySkipped = 0; std::vector<ui64, TMKQLAllocator<ui64, EMemorySubPool::Temporary>> joinSlots, spillSlots, slotToIdx; std::vector<ui32, TMKQLAllocator<ui32, EMemorySubPool::Temporary>> stringsOffsets1, stringsOffsets2; @@ -339,13 +332,12 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef TTableBucket * bucket2 = &JoinTable2->TableBuckets[bucket]; KeysHashTable& kh1 = bucket1->AnyHashTable; - KeysHashTable& kh2 = bucket2->AnyHashTable; + KeysHashTable& kh2 = bucket2->AnyHashTable; ui64 headerSize1 = JoinTable1->HeaderSize; ui64 headerSize2 = JoinTable2->HeaderSize; ui64 nullsSize1 = JoinTable1->NullsBitmapSize_; ui64 nullsSize2 = JoinTable2->NullsBitmapSize_; - ui64 numberOfKeyIntColumns1 = JoinTable1->NumberOfKeyIntColumns; ui64 keyIntOffset1 = HashSize + nullsSize1; ui64 keyIntOffset2 = HashSize + nullsSize2; @@ -377,12 +369,12 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef kh1.NSlots = nSlots; kh1.SlotSize = slotSize; - - + + kh2.NSlots = nSlots; kh2.SlotSize = slotSize; - ui32 tuple2Idx = 0; + ui32 tuple2Idx = 0; auto it2 = bucket2->KeyIntVals.begin(); while (it2 != bucket2->KeyIntVals.end() ) { @@ -430,7 +422,7 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef ui32 tuple1Idx = 0; auto it1 = bucket1->KeyIntVals.begin(); while ( it1 < bucket1->KeyIntVals.end() ) { - + ui64 keysValSize; if ( JoinTable1->NumberOfKeyStringColumns > 0 || JoinTable1->NumberOfKeyIColumns > 0) { keysValSize = headerSize1 + *(it1 + headerSize1 - 1) ; @@ -450,7 +442,6 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef ui64 slotNum = hash % nSlots; auto slotIt = joinSlots.begin() + slotNum * slotSize; - ui64 collisions = 0; while (*slotIt != 0 && slotIt != joinSlots.end()) { bool matchFound = false; @@ -487,8 +478,6 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef if (keysValSize > slotSize ) { ui64 stringsPos = *(slotIt + headerSize2); slotStringsStart = spillSlots.begin() + stringsPos; - ui64 stringsSize = *(slotIt + headerSize2 - 1); - } if ( JoinTable1->NumberOfKeyStringColumns == 0) { @@ -540,7 +529,7 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef if (slotIt == joinSlots.end()) slotIt = joinSlots.begin(); } - + it1 += keysValSize; tuple1Idx ++; @@ -552,7 +541,7 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef return false; }); - + TableBuckets[bucket].JoinIds.assign(joinResults.begin(), joinResults.end()); std::vector<ui32, TMKQLAllocator<ui32>> & rightIds = TableBuckets[bucket].RightIds; @@ -573,22 +562,20 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef std::sort(rightIds.begin(), rightIds.end()); } - if ( JoinKind == EJoinKind::Left || JoinKind == EJoinKind::LeftOnly || JoinKind == EJoinKind::LeftSemi ) { + if (JoinKind == EJoinKind::Left || JoinKind == EJoinKind::LeftOnly || JoinKind == EJoinKind::LeftSemi ) { if (RightTableBatch_ ) { for (auto & jid: joinIds ) { leftMatchedIds.insert(jid.id1); } - leftIdsMatch += leftMatchedIds.size(); } } - if( JoinKind == EJoinKind::Right || JoinKind == EJoinKind::RightOnly || JoinKind == EJoinKind::RightSemi ) { + if (JoinKind == EJoinKind::Right || JoinKind == EJoinKind::RightOnly || JoinKind == EJoinKind::RightSemi ) { if (LeftTableBatch_) { for (auto & jid: joinIds ) { leftMatchedIds.insert(jid.id1); } - leftIdsMatch += leftMatchedIds.size(); } } @@ -637,7 +624,7 @@ inline void TTable::GetTupleData(ui32 bucketNum, ui32 tupleId, TupleData & td) { keyStringsOffset = tb.StringsOffsets[stringsOffsetsIdx] + HeaderSize; strPtr = reinterpret_cast<char *>(tb.KeyIntVals.data() + keyStringsOffset); - + for (ui64 i = 0; i < NumberOfKeyStringColumns; ++i) { td.StrColumns[i] = strPtr; @@ -679,7 +666,7 @@ inline void TTable::GetTupleData(ui32 bucketNum, ui32 tupleId, TupleData & td) { strPtr += currSize; } - + } inline bool TTable::HasJoinedTupleId(TTable *joinedTable, ui32 &tupleId2) { @@ -745,7 +732,6 @@ inline bool TTable::AddKeysToHashTable(KeysHashTable& t, ui64* keys) { bool headerMatch = false; bool stringsMatch = false; - bool iValuesMatch = false; headerMatch = std::equal(it + keyIntOffset, it + HeaderSize, keys + keyIntOffset); if (!headerMatch) { break; @@ -787,14 +773,14 @@ inline bool TTable::AddKeysToHashTable(KeysHashTable& t, ui64* keys) { ui64 spillDataOffset = t.SpillData.size(); t.SpillData.insert(t.SpillData.end(), keys + HeaderSize, keys + keysSize); std::copy_n(keys, HeaderSize, it); - *(it + HeaderSize) = spillDataOffset; + *(it + HeaderSize) = spillDataOffset; } else { std::copy_n(keys, keysSize, it); } t.FillCount++; return true; - + } inline bool HasRightIdMatch(ui64 currId, ui64 & rightIdIter, const std::vector<ui32, TMKQLAllocator<ui32>> & rightIds) { @@ -936,7 +922,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { std::set<ui32> & leftMatchedIds = TableBuckets[JoinTable1->CurrIterBucket].AllLeftMatchedIds; globalMatchedId = leftMatchedIds.contains( (ui32) JoinTable1->CurrIterIndex); } - + if (!HasJoinedTupleId(JoinTable1, tupleId2) && !globalMatchedId ) { JoinTable1->GetTupleData(CurrIterBucket, JoinTable1->CurrIterIndex, td1); @@ -945,7 +931,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { return true; } else { while (HasJoinedTupleId(JoinTable1, tupleId2)) { - CurrJoinIdsIterIndex++; + CurrJoinIdsIterIndex++; } } JoinTable1->CurrIterIndex++; @@ -976,7 +962,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { return true; } else { while (HasJoinedTupleId(JoinTable1, tupleId2)) { - CurrJoinIdsIterIndex++; + CurrJoinIdsIterIndex++; } } JoinTable1->CurrIterIndex++; @@ -1001,7 +987,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { td2.AllNulls = true; while( HasJoinedTupleId(JoinTable1, tupleId2) ) { CurrJoinIdsIterIndex++; - } + } JoinTable1->CurrIterIndex++; return true; } @@ -1033,7 +1019,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { td1.AllNulls = true; while( HasJoinedTupleId(JoinTable1, tupleId2) ) { CurrJoinIdsIterIndex++; - } + } JoinTable1->CurrIterIndex++; return true; } @@ -1086,7 +1072,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { JoinTable2->GetTupleData(JoinTable2->CurrIterBucket, JoinTable2->CurrIterIndex, td2); JoinTable2->CurrIterIndex++; return true; - + } td1.AllNulls = true; @@ -1111,7 +1097,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { JoinTable1->CurrIterIndex++; return true; } - + td1.AllNulls = true; while (HasMoreTuples(JoinTable2->TableBuckets, JoinTable2->CurrIterBucket, JoinTable2->CurrIterIndex)) { @@ -1128,7 +1114,7 @@ bool TTable::NextJoinedData( TupleData & td1, TupleData & td2) { JoinTable2->GetTupleData(JoinTable2->CurrIterBucket, JoinTable2->CurrIterIndex, td2); JoinTable2->CurrIterIndex++; return true; - + } td1.AllNulls = true; @@ -1154,7 +1140,6 @@ void TTable::Clear() { tb.InterfaceOffsets.clear(); tb.JoinIds.clear(); tb.RightIds.clear(); -// tb.AnyHashTable = KeysHashTable{0, 0, 0, {}, {}}; } @@ -1168,14 +1153,14 @@ TTable::TTable( ui64 numberOfKeyIntColumns, ui64 numberOfKeyStringColumns, NumberOfKeyIntColumns(numberOfKeyIntColumns), NumberOfKeyStringColumns(numberOfKeyStringColumns), + NumberOfKeyIColumns(numberOfKeyIColumns), NumberOfDataIntColumns(numberOfDataIntColumns), NumberOfDataStringColumns(numberOfDataStringColumns), - NumberOfKeyIColumns(numberOfKeyIColumns), NumberOfDataIColumns(numberOfDataIColumns), - NullsBitmapSize_(nullsBitmapSize), ColInterfaces(colInterfaces), + NullsBitmapSize_(nullsBitmapSize), IsAny_(isAny) { - + NumberOfKeyColumns = NumberOfKeyIntColumns + NumberOfKeyStringColumns + NumberOfKeyIColumns; NumberOfDataColumns = NumberOfDataIntColumns + NumberOfDataStringColumns + NumberOfDataIColumns; NumberOfColumns = NumberOfKeyColumns + NumberOfDataColumns; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_iterator.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_iterator.cpp index 39f94a66fb..482105485f 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_iterator.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_iterator.cpp @@ -178,7 +178,7 @@ private: this->DependsOn(Flow); } - [[noinline]] [[noreturn]] static void Throw() { + [[noreturn]] static void Throw() { UdfTerminate("Unexpected flow status."); } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_join.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_join.cpp index bbfa8f830d..dbb903565d 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_join.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_join.cpp @@ -1009,7 +1009,7 @@ public: } template <bool IsLeftNull> - void PrepareNullItem(TComputationContext& ctx, NUdf::TUnboxedValue*const* output) { + void PrepareNullItem(TComputationContext&, NUdf::TUnboxedValue*const* output) { for (ui32 i = 0; i < Self->LeftInputColumns.size(); ++i) { if (const auto out = output[Self->LeftOutputColumns[i]]) { if constexpr (IsLeftNull) { diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_listfromrange.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_listfromrange.cpp index b3bd9f1f61..f1eeeb05af 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_listfromrange.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_listfromrange.cpp @@ -221,8 +221,7 @@ private: } } TTzValue(TMemoryUsageInfo* memInfo, TComputationContext& ctx, T start, T end, TStep step, ui16 TimezoneId) - : TimezoneId(TimezoneId) - , TValue(memInfo, ctx, start, end, step) + : TValue(memInfo, ctx, start, end, step), TimezoneId(TimezoneId) { } private: diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_llvm_base.h b/ydb/library/yql/minikql/comp_nodes/mkql_llvm_base.h index 2ea90be43b..f426ea949c 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_llvm_base.h +++ b/ydb/library/yql/minikql/comp_nodes/mkql_llvm_base.h @@ -1,4 +1,6 @@ #pragma once + +#ifndef MKQL_DISABLE_CODEGEN #include <ydb/library/yql/minikql/computation/mkql_computation_node_impl.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Type.h> @@ -54,5 +56,5 @@ public: } }; - } +#endif diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_multihopping.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_multihopping.cpp index 47df2509ce..369907e713 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_multihopping.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_multihopping.cpp @@ -55,10 +55,10 @@ public: , HopTime(hopTime) , IntervalHopCount(intervalHopCount) , DelayHopCount(delayHopCount) - , StatesMap(0, hash, equal) - , Ctx(ctx) , Watermark(watermark) , WatermarkMode(watermarkMode) + , StatesMap(0, hash, equal) + , Ctx(ctx) { if (!watermarkMode && dataWatermarks) { DataWatermarkTracker.emplace(TWatermarkTracker(delayHopCount * hopTime, hopTime)); @@ -135,7 +135,7 @@ public: const auto statesMapSize = ReadUi32(in); ClearState(); StatesMap.reserve(statesMapSize); - for (int i = 0; i < statesMapSize; i++) { + for (auto i = 0U; i < statesMapSize; ++i) { auto key = ReadUnboxedValue(in, Self->KeyPacker.RefMutableObject(Ctx, false, Self->KeyType), Ctx); const auto hopIndex = ReadUi64(in); const auto bucketsSize = ReadUi32(in); @@ -297,7 +297,7 @@ public: auto& bucketsForKey = keyState.Buckets; bool becameEmpty = false; - for (auto i = 0; i < bucketsForKey.size(); i++) { + for (auto i = 0U; i < bucketsForKey.size(); ++i) { const auto curHopIndex = keyState.HopIndex; if (curHopIndex >= closeBeforeIndex) { break; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_range.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_range.cpp index 256d757577..8aefed1cf6 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_range.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_range.cpp @@ -277,9 +277,8 @@ bool RangeCanMerge(const TExpandedRange& a, const TExpandedRange& b, const TRang class TRangeComputeBase { public: - TRangeComputeBase(TComputationMutables& mutables, TComputationNodePtrVector&& lists, std::vector<TRangeTypeInfo>&& typeInfos) - : TypeInfos(std::move(typeInfos)) - , Lists(std::move(lists)) + TRangeComputeBase(TComputationMutables&, TComputationNodePtrVector&& lists, std::vector<TRangeTypeInfo>&& typeInfos) + : Lists(std::move(lists)), TypeInfos(std::move(typeInfos)) { Y_ENSURE(Lists.size() == TypeInfos.size()); Y_ENSURE(!Lists.empty()); diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_scalar_apply.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_scalar_apply.cpp index 7d7b42f988..56f5e973fc 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_scalar_apply.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_scalar_apply.cpp @@ -19,7 +19,7 @@ class TScalarApplyWrapper : public TMutableComputationNode<TScalarApplyWrapper> friend class TArrowNode; public: struct TAccessors { - TAccessors(const TVector<TType*>& argsTypes, TType* returnType, const NUdf::IPgBuilder& pgBuilder) + TAccessors(const TVector<TType*>& argsTypes, TType* returnType, const NUdf::IPgBuilder& pgBuilder) : PgBuilder(pgBuilder) { auto returnItemType = AS_TYPE(TBlockType, returnType)->GetItemType(); @@ -44,14 +44,14 @@ public: : Alloc(__LOCATION__) , MemInfo("ScalarApply") , HolderFactory(Alloc.Ref(), MemInfo) - , ValueBuilder(HolderFactory, NUdf::EValidatePolicy::Exception) + , ValueBuilder(HolderFactory, NUdf::EValidatePolicy::Exception) , PgBuilder(NYql::CreatePgBuilder()) , Accessors(argsTypes, returnType, *PgBuilder) , ArrowMemoryPool(MakeArrowMemoryPool(Alloc.Ref())) , RandomProvider(CreateDefaultRandomProvider()) , TimeProvider(CreateDefaultTimeProvider()) , Ctx(HolderFactory, &ValueBuilder, TComputationOptsFull( - nullptr, Alloc.Ref(), *RandomProvider, *TimeProvider, NUdf::EValidatePolicy::Exception, nullptr), + nullptr, Alloc.Ref(), *RandomProvider, *TimeProvider, NUdf::EValidatePolicy::Exception, nullptr), originalContext.Mutables, *ArrowMemoryPool) { Alloc.Release(); @@ -80,7 +80,7 @@ public: : Parent_(parent) , OriginalContext_(originalContext) , ArgsValuesDescr_(ToValueDescr(parent->ArgsTypes_)) - , Kernel_(ConvertToInputTypes(parent->ArgsTypes_), ConvertToOutputType(parent->ReturnType_), [parent, this](arrow::compute::KernelContext* ctx, const arrow::compute::ExecBatch& batch, arrow::Datum* res) { + , Kernel_(ConvertToInputTypes(parent->ArgsTypes_), ConvertToOutputType(parent->ReturnType_), [parent](arrow::compute::KernelContext* ctx, const arrow::compute::ExecBatch& batch, arrow::Datum* res) { auto& state = dynamic_cast<TKernelState&>(*ctx->state()); auto guard = Guard(state.Alloc); TVector<TDatumProvider> providers; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_sort.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_sort.cpp index 74181817a9..ab7a3a0834 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_sort.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_sort.cpp @@ -199,8 +199,8 @@ struct TCompareDescr { const TVector<NUdf::ICompare::TPtr>& comparators) : KeySchemeTypes(std::move(keySchemeTypes)) , KeyTypes(PrepareKeyTypesByScheme(KeySchemeTypes)) - , Encoders(mutables) , Comparators(comparators) + , Encoders(mutables) {} static TKeyPayloadPairVector::value_type::first_type& Set(TKeyPayloadPairVector::value_type& item) { return item.first; } @@ -220,7 +220,6 @@ struct TCompareDescr { const auto& right = Get(y); for (ui32 i = 0; i < KeyTypes.size(); ++i) { - const auto& keyType = KeyTypes[i]; const auto& leftElem = left.GetElement(i); const auto& rightElem = right.GetElement(i); const bool asc = ascending.GetElement(i).Get<bool>(); @@ -450,7 +449,7 @@ public: return result; } - void PerformInplace(TComputationContext& ctx, ui32 size, NUdf::TUnboxedValue* keys, NUdf::TUnboxedValue* items, const TComparator& comparator) const { + void PerformInplace(TComputationContext&, ui32 size, NUdf::TUnboxedValue* keys, NUdf::TUnboxedValue* items, const TComparator& comparator) const { AlgorithmInplace(TGatherIterator(keys, items), TGatherIterator(keys, items) + size, comparator); } diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_source.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_source.cpp index d53311791f..4939f3558a 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_source.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_source.cpp @@ -72,7 +72,7 @@ IComputationNode* WrapSourceOf(TCallable& callable, const TComputationNodeFactor THROW yexception() << "Expected flow or stream."; } -IComputationNode* WrapSource(TCallable& callable, const TComputationNodeFactoryContext& ctx) { +IComputationNode* WrapSource(TCallable& callable, const TComputationNodeFactoryContext&) { MKQL_ENSURE(!callable.GetInputsCount(), "Expected no args."); MKQL_ENSURE(!GetWideComponentsCount(AS_TYPE(TFlowType, callable.GetType()->GetReturnType())), "Expected zero width of output flow."); return new TSourceWrapper; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_squeeze_to_list.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_squeeze_to_list.cpp index 34ec53e0ac..1b594bee99 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_squeeze_to_list.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_squeeze_to_list.cpp @@ -16,7 +16,6 @@ public: class TState: public TComputationValue<TState> { using TBase = TComputationValue<TState>; public: - using TLLVMBase = TLLVMFieldsStructure<TBase>; TState(TMemoryUsageInfo* memInfo, ui64 limit) : TBase(memInfo), Limit(limit) { } @@ -32,7 +31,7 @@ public: return list; } - bool Push(NUdf::TUnboxedValuePod value) { + bool Put(NUdf::TUnboxedValuePod value) { Accumulator.emplace_back(std::move(value)); return Limit != 0 && Limit <= Accumulator.size(); } @@ -56,7 +55,7 @@ public: while (const auto statePtr = static_cast<TState*>(state.AsBoxed().Get())) { if (auto item = Flow->GetValue(ctx); item.IsYield()) { return item.Release(); - } else if (item.IsFinish() || statePtr->Push(item.Release())) { + } else if (item.IsFinish() || statePtr->Put(item.Release())) { const auto list = statePtr->Pull(ctx); state = NUdf::TUnboxedValuePod::MakeFinish(); return list; @@ -66,9 +65,9 @@ public: } #ifndef MKQL_DISABLE_CODEGEN - class TLLVMFieldsStructureForState: public TState::TLLVMBase { + class TLLVMFieldsStructureForState: public TLLVMFieldsStructure<TComputationValue<TState>> { private: - using TBase = typename TState::TLLVMBase; + using TBase = TLLVMFieldsStructure<TComputationValue<TState>>; llvm::PointerType* StructPtrType; protected: using TBase::Context; @@ -140,7 +139,7 @@ public: block = plus; - const auto push = ConstantInt::get(Type::getInt64Ty(context), GetMethodPtr(&TState::Push)); + const auto push = ConstantInt::get(Type::getInt64Ty(context), GetMethodPtr(&TState::Put)); const auto arg = WrapArgumentForWindows(item, ctx, block); diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_switch.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_switch.cpp index 448828e582..659af677da 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_switch.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_switch.cpp @@ -33,7 +33,6 @@ using TSwitchHandlersList = std::vector<TSwitchHandler, TMKQLAllocator<TSwitchHa class TState : public TComputationValue<TState> { typedef TComputationValue<TState> TBase; public: - using TLLVMBase = TLLVMFieldsStructure<TComputationValue<TState>>; TState(TMemoryUsageInfo* memInfo, ui32 size) : TBase(memInfo), ChildReadIndex(size) {} @@ -43,9 +42,9 @@ public: }; #ifndef MKQL_DISABLE_CODEGEN -class TLLVMFieldsStructureForState: public TState::TLLVMBase { +class TLLVMFieldsStructureForState: public TLLVMFieldsStructure<TComputationValue<TState>> { private: - using TBase = TState::TLLVMBase; + using TBase = TLLVMFieldsStructure<TComputationValue<TState>>; llvm::IntegerType* IndexType; llvm::IntegerType* StatusType; const ui32 FieldsCount = 0; @@ -92,7 +91,6 @@ class TSwitchFlowWrapper : public TStatefulFlowCodegeneratorNode<TSwitchFlowWrap private: class TFlowState : public TState { public: - using TLLVMBase = TLLVMFieldsStructureForState; TFlowState(TMemoryUsageInfo* memInfo, TAlignedPagePool& pool, ui32 size) : TState(memInfo, size), Buffer(pool) {} @@ -126,7 +124,7 @@ private: Position = 0U; } - NUdf::TUnboxedValuePod Handler(ui32 index, const TSwitchHandler& handler, TComputationContext& ctx) { + NUdf::TUnboxedValuePod Handler(ui32, const TSwitchHandler& handler, TComputationContext& ctx) { while (true) { auto current = Get(Position++); if (current.IsSpecial()) { @@ -245,9 +243,9 @@ public: } #ifndef MKQL_DISABLE_CODEGEN private: - class TLLVMFieldsStructureForFlowState: public TFlowState::TLLVMBase { + class TLLVMFieldsStructureForFlowState: public TLLVMFieldsStructureForState { private: - using TBase = typename TFlowState::TLLVMBase; + using TBase = TLLVMFieldsStructureForState; llvm::PointerType* StructPtrType; llvm::IntegerType* IndexType; protected: @@ -628,8 +626,6 @@ private: class TValueBase : public TState { public: - using TLLVMBase = TLLVMFieldsStructureForState; - void Add(NUdf::TUnboxedValue&& item) { Buffer.Add(std::move(item)); } @@ -776,9 +772,9 @@ private: } #ifndef MKQL_DISABLE_CODEGEN - class TLLVMFieldsStructureForValueBase: public TValueBase::TLLVMBase { + class TLLVMFieldsStructureForValueBase: public TLLVMFieldsStructureForState { private: - using TBase = typename TValueBase::TLLVMBase; + using TBase = TLLVMFieldsStructureForState; protected: using TBase::Context; public: diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_tobytes.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_tobytes.cpp index 876eef4ad6..2bd88da4d3 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_tobytes.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_tobytes.cpp @@ -17,7 +17,7 @@ public: : TBaseComputation(data) {} - NUdf::TUnboxedValuePod DoCalculate(TComputationContext& compCtx, const NUdf::TUnboxedValuePod& value) const { + NUdf::TUnboxedValuePod DoCalculate(TComputationContext&, const NUdf::TUnboxedValuePod& value) const { if (IsOptional && !value) return NUdf::TUnboxedValuePod(); @@ -46,7 +46,7 @@ public: : TBaseComputation(data) {} - NUdf::TUnboxedValuePod DoCalculate(TComputationContext& compCtx, const NUdf::TUnboxedValuePod& value) const { + NUdf::TUnboxedValuePod DoCalculate(TComputationContext&, const NUdf::TUnboxedValuePod& value) const { if (IsOptional && !value) return NUdf::TUnboxedValuePod(); diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_todict.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_todict.cpp index 717e396e1c..96d6bd17f1 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_todict.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_todict.cpp @@ -42,8 +42,8 @@ public: THashedMultiMapAccumulator(TType* keyType, TType* payloadType, const TKeyTypes& keyTypes, bool isTuple, bool encoded, NUdf::ICompare::TPtr compare, NUdf::IEquate::TPtr equate, NUdf::IHash::TPtr hash, TComputationContext& ctx, ui64 itemsCountHint) - : Ctx(ctx), KeyType(keyType), KeyTypes(keyTypes), IsTuple(isTuple), Map(0, TValueHasher(KeyTypes, isTuple, hash), - TValueEqual(KeyTypes, isTuple, equate)), Hash(hash), Equate(equate) + : Ctx(ctx), KeyType(keyType), KeyTypes(keyTypes), IsTuple(isTuple), Hash(hash), Equate(equate) + , Map(0, TValueHasher(KeyTypes, isTuple, hash), TValueEqual(KeyTypes, isTuple, equate)) { Y_UNUSED(compare); if (encoded) { @@ -95,8 +95,8 @@ public: THashedMapAccumulator(TType* keyType, TType* payloadType, const TKeyTypes& keyTypes, bool isTuple, bool encoded, NUdf::ICompare::TPtr compare, NUdf::IEquate::TPtr equate, NUdf::IHash::TPtr hash, TComputationContext& ctx, ui64 itemsCountHint) - : Ctx(ctx), KeyType(keyType), KeyTypes(keyTypes), IsTuple(isTuple), Map(0, TValueHasher(KeyTypes, isTuple, hash), - TValueEqual(KeyTypes, isTuple, equate)), Hash(hash), Equate(equate) + : Ctx(ctx), KeyType(keyType), KeyTypes(keyTypes), IsTuple(isTuple), Hash(hash), Equate(equate) + , Map(0, TValueHasher(KeyTypes, isTuple, hash), TValueEqual(KeyTypes, isTuple, equate)) { Y_UNUSED(compare); if (encoded) { @@ -882,7 +882,6 @@ public: class TState : public TComputationValue<TState> { using TBase = TComputationValue<TState>; public: - using TLLVMBase = TLLVMFieldsStructure<TBase>; TState(TMemoryUsageInfo* memInfo, TSetAccumulator&& setAccum) : TBase(memInfo), SetAccum(std::move(setAccum)) {} @@ -941,7 +940,7 @@ public: const auto valueType = Type::getInt128Ty(context); const auto structPtrType = PointerType::getUnqual(StructType::get(context)); - TLLVMFieldsStructureStateWithAccum<typename TState::TLLVMBase> fieldsStruct(context); + TLLVMFieldsStructureStateWithAccum<TLLVMFieldsStructure<TComputationValue<TState>>> fieldsStruct(context); const auto stateType = StructType::get(context, fieldsStruct.GetFieldsArray()); const auto statePtrType = PointerType::getUnqual(stateType); @@ -1062,7 +1061,6 @@ public: class TState : public TComputationValue<TState> { using TBase = TComputationValue<TState>; public: - using TLLVMBase = TLLVMFieldsStructure<TBase>; TState(TMemoryUsageInfo* memInfo, TSetAccumulator&& setAccum) : TBase(memInfo), SetAccum(std::move(setAccum)) {} @@ -1127,7 +1125,7 @@ public: const auto valueType = Type::getInt128Ty(context); const auto structPtrType = PointerType::getUnqual(StructType::get(context)); - TLLVMFieldsStructureStateWithAccum<typename TState::TLLVMBase> fieldsStruct(context); + TLLVMFieldsStructureStateWithAccum<TLLVMFieldsStructure<TComputationValue<TState>>> fieldsStruct(context); const auto stateType = StructType::get(context, fieldsStruct.GetFieldsArray()); const auto statePtrType = PointerType::getUnqual(stateType); @@ -1380,7 +1378,6 @@ public: class TState : public TComputationValue<TState> { using TBase = TComputationValue<TState>; public: - using TLLVMBase = TLLVMFieldsStructure<TBase>; TState(TMemoryUsageInfo* memInfo, TMapAccumulator&& mapAccum) : TBase(memInfo), MapAccum(std::move(mapAccum)) {} @@ -1441,7 +1438,7 @@ public: const auto valueType = Type::getInt128Ty(context); const auto structPtrType = PointerType::getUnqual(StructType::get(context)); - TLLVMFieldsStructureStateWithAccum<typename TState::TLLVMBase> fieldsStruct(context); + TLLVMFieldsStructureStateWithAccum<TLLVMFieldsStructure<TComputationValue<TState>>> fieldsStruct(context); const auto stateType = StructType::get(context, fieldsStruct.GetFieldsArray()); const auto statePtrType = PointerType::getUnqual(stateType); @@ -1567,7 +1564,6 @@ public: class TState : public TComputationValue<TState> { using TBase = TComputationValue<TState>; public: - using TLLVMBase = TLLVMFieldsStructure<TBase>; TState(TMemoryUsageInfo* memInfo, TMapAccumulator&& mapAccum) : TBase(memInfo), MapAccum(std::move(mapAccum)) {} @@ -1636,7 +1632,7 @@ public: const auto valueType = Type::getInt128Ty(context); const auto structPtrType = PointerType::getUnqual(StructType::get(context)); - TLLVMFieldsStructureStateWithAccum<typename TState::TLLVMBase> fieldsStruct(context); + TLLVMFieldsStructureStateWithAccum<TLLVMFieldsStructure<TComputationValue<TState>>> fieldsStruct(context); const auto stateType = StructType::get(context, fieldsStruct.GetFieldsArray()); const auto statePtrType = PointerType::getUnqual(stateType); diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp index 6cf1ec5499..d0460ccf85 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp @@ -151,8 +151,6 @@ struct TCombinerNodes { class TState : public TComputationValue<TState> { typedef TComputationValue<TState> TBase; -public: - using TLLVMBase = TLLVMFieldsStructure<TComputationValue<TState>>; private: using TStates = TRobinHoodHashSet<NUdf::TUnboxedValuePod*, TEqualsFunc, THashFunc, TMKQLAllocator<char, EMemorySubPool::Temporary>>; using TRow = std::vector<NUdf::TUnboxedValuePod, TMKQLAllocator<NUdf::TUnboxedValuePod>>; @@ -284,9 +282,9 @@ private: }; #ifndef MKQL_DISABLE_CODEGEN -class TLLVMFieldsStructureState: public TState::TLLVMBase { +class TLLVMFieldsStructureState: public TLLVMFieldsStructure<TComputationValue<TState>> { private: - using TBase = TState::TLLVMBase; + using TBase = TLLVMFieldsStructure<TComputationValue<TState>>; llvm::IntegerType* ValueType; llvm::PointerType* PtrValueType; llvm::IntegerType* StatusType; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_wide_condense.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_wide_condense.cpp index 22eac4ba39..a8cce738e2 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_wide_condense.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_wide_condense.cpp @@ -26,12 +26,12 @@ public: , State(std::move(state)) , Switch(outSwitch) , UpdateState(std::move(updateState)) - , WideFieldsIndex(mutables.IncrementWideFieldsIndex(Items.size())) - , TempStateIndex(std::exchange(mutables.CurValueIndex, mutables.CurValueIndex + State.size())) , SwitchItem(IsPasstrought(Switch, Items)) , ItemsOnInit(GetPasstroughtMap(Items, InitState)) , ItemsOnUpdate(GetPasstroughtMap(Items, UpdateState)) , UpdateOnItems(GetPasstroughtMap(UpdateState, Items)) + , WideFieldsIndex(mutables.IncrementWideFieldsIndex(Items.size())) + , TempStateIndex(std::exchange(mutables.CurValueIndex, mutables.CurValueIndex + State.size())) {} EFetchResult DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx, NUdf::TUnboxedValue*const* output) const { 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 551b98a9a7..80969cfd78 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 @@ -73,8 +73,6 @@ using TCompareFunc = std::function<int(const bool*, const NUdf::TUnboxedValuePod template <bool HasCount> class TState : public TComputationValue<TState<HasCount>> { using TBase = TComputationValue<TState<HasCount>>; -public: -using TLLVMBase = TLLVMFieldsStructure<TComputationValue<TState<HasCount>>>; private: using TStorage = std::vector<NUdf::TUnboxedValue, TMKQLAllocator<NUdf::TUnboxedValue, EMemorySubPool::Temporary>>; using TFields = std::vector<NUdf::TUnboxedValue*, TMKQLAllocator<NUdf::TUnboxedValue*, EMemorySubPool::Temporary>>; @@ -126,7 +124,7 @@ public: return Fields.data(); } - bool Push() { + bool Put() { if constexpr (!HasCount) { ResetFields(); return true; @@ -210,9 +208,9 @@ private: #ifndef MKQL_DISABLE_CODEGEN template <bool HasCount> -class TLLVMFieldsStructureState: public TState<HasCount>::TLLVMBase { +class TLLVMFieldsStructureState: public TLLVMFieldsStructure<TComputationValue<TState<HasCount>>> { private: - using TBase = typename TState<HasCount>::TLLVMBase; + using TBase = TLLVMFieldsStructure<TComputationValue<TState<HasCount>>>; llvm::IntegerType* ValueType; llvm::PointerType* PtrValueType; llvm::IntegerType* StatusType; @@ -288,7 +286,7 @@ public: while (EFetchResult::Finish != ptr->InputStatus) { switch (ptr->InputStatus = Flow->FetchValues(ctx, ptr->GetFields())) { case EFetchResult::One: - ptr->Push(); + ptr->Put(); continue; case EFetchResult::Yield: return EFetchResult::Yield; @@ -443,7 +441,7 @@ public: } - const auto pushFunc = ConstantInt::get(Type::getInt64Ty(context), GetMethodPtr(&TState<HasCount>::Push)); + const auto pushFunc = ConstantInt::get(Type::getInt64Ty(context), GetMethodPtr(&TState<HasCount>::Put)); const auto pushType = FunctionType::get(Type::getInt1Ty(context), {stateArg->getType()}, false); const auto pushPtr = CastInst::Create(Instruction::IntToPtr, pushFunc, PointerType::getUnqual(pushType), "function", block); const auto accepted = CallInst::Create(pushType, pushPtr, {stateArg}, "accepted", block); diff --git a/ydb/library/yql/minikql/compact_hash.h b/ydb/library/yql/minikql/compact_hash.h index a9586db464..9dcc96e81b 100644 --- a/ydb/library/yql/minikql/compact_hash.h +++ b/ydb/library/yql/minikql/compact_hash.h @@ -982,15 +982,6 @@ public: } public: - TIteratorImpl& operator=(const TIteratorImpl& rhs) { - Hash = rhs.Hash; - Bucket = rhs.Bucket; - EndBucket = rhs.EndBucket; - Pos = rhs.Pos; - SubPos = rhs.SubPos; - return *this; - } - bool Ok() const { return Bucket < EndBucket; } diff --git a/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h b/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h index eefb2c24b9..d2f4471e3f 100644 --- a/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h +++ b/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h @@ -248,7 +248,7 @@ protected: node->SetOwner(this); } } - + const EValueRepresentation RepresentationKind; private: bool IsTemporaryValue() const final { @@ -473,7 +473,7 @@ template <typename TDerived, bool SerializableState = false> class TStatefulFlowComputationNode: public TBaseFlowBaseComputationNode<TDerived> { protected: - TStatefulFlowComputationNode(TComputationMutables& mutables, const IComputationNode* source, EValueRepresentation kind, EValueRepresentation stateKind) + TStatefulFlowComputationNode(TComputationMutables& mutables, const IComputationNode* source, EValueRepresentation kind, EValueRepresentation stateKind = EValueRepresentation::Any) : TBaseFlowBaseComputationNode<TDerived>(source, kind), StateIndex(mutables.CurValueIndex++), StateKind(stateKind) { if constexpr (SerializableState) { @@ -546,11 +546,10 @@ private: class TWideFlowProxyComputationNode: public TRefCountedComputationNode<IComputationWideFlowProxyNode> { -protected: +public: TWideFlowProxyComputationNode() = default; - +protected: TString DebugString() const final; - private: void InitNode(TComputationContext&) const override {} |