diff options
| author | vvvv <[email protected]> | 2025-06-23 13:38:54 +0300 | 
|---|---|---|
| committer | vvvv <[email protected]> | 2025-06-23 14:22:17 +0300 | 
| commit | 99a63eaece7367f17dac58e66e45043aa641d9f7 (patch) | |
| tree | d104b51aab8eaf495f95d81525716e34b5bef983 /yql/essentials/minikql/computation | |
| parent | a731af300f45dd4cb0f3fd3b24c8213fe1425068 (diff) | |
YQL-20086 minikql
commit_hash:c35c972d6708fb1b3f34fa34a42cdae1ddf11cdc
Diffstat (limited to 'yql/essentials/minikql/computation')
30 files changed, 1828 insertions, 1822 deletions
| diff --git a/yql/essentials/minikql/computation/mkql_block_impl.cpp b/yql/essentials/minikql/computation/mkql_block_impl.cpp index 0f16206c112..91292a3df81 100644 --- a/yql/essentials/minikql/computation/mkql_block_impl.cpp +++ b/yql/essentials/minikql/computation/mkql_block_impl.cpp @@ -252,14 +252,14 @@ TBlockFuncNode::TBlockFuncNode(TComputationMutables& mutables, TStringBuf name,      std::shared_ptr<arrow::compute::ScalarKernel> kernelHolder,      const arrow::compute::FunctionOptions* functionOptions)      : TMutableComputationNode(mutables) -    , StateIndex(mutables.CurValueIndex++) -    , ArgsNodes(std::move(argsNodes)) -    , ArgsValuesDescr(ToValueDescr(argsTypes)) -    , Kernel(kernel) -    , KernelHolder(std::move(kernelHolder)) -    , Options(functionOptions) -    , ScalarOutput(GetResultShape(argsTypes) == TBlockType::EShape::Scalar) -    , Name(name.starts_with("Block") ? name.substr(5) : name) +    , StateIndex_(mutables.CurValueIndex++) +    , ArgsNodes_(std::move(argsNodes)) +    , ArgsValuesDescr_(ToValueDescr(argsTypes)) +    , Kernel_(kernel) +    , KernelHolder_(std::move(kernelHolder)) +    , Options_(functionOptions) +    , ScalarOutput_(GetResultShape(argsTypes) == TBlockType::EShape::Scalar) +    , Name_(name.starts_with("Block") ? name.substr(5) : name)  {  } @@ -267,15 +267,15 @@ NUdf::TUnboxedValuePod TBlockFuncNode::DoCalculate(TComputationContext& ctx) con      auto& state = GetState(ctx);      std::vector<arrow::Datum> argDatums; -    for (ui32 i = 0; i < ArgsNodes.size(); ++i) { -        const auto& value = ArgsNodes[i]->GetValue(ctx); +    for (ui32 i = 0; i < ArgsNodes_.size(); ++i) { +        const auto& value = ArgsNodes_[i]->GetValue(ctx);          argDatums.emplace_back(TArrowBlock::From(value).GetDatum()); -        ARROW_DEBUG_CHECK_DATUM_TYPES(ArgsValuesDescr[i], argDatums.back().descr()); +        ARROW_DEBUG_CHECK_DATUM_TYPES(ArgsValuesDescr_[i], argDatums.back().descr());      } -    if (ScalarOutput) { +    if (ScalarOutput_) {          auto executor = arrow::compute::detail::KernelExecutor::MakeScalar(); -        ARROW_OK(executor->Init(&state.KernelContext, { &Kernel, ArgsValuesDescr, Options })); +        ARROW_OK(executor->Init(&state.KernelContext, { &Kernel_, ArgsValuesDescr_, Options_ }));          auto listener = std::make_shared<arrow::compute::detail::DatumAccumulator>();          ARROW_OK(executor->Execute(argDatums, listener.get())); @@ -289,7 +289,7 @@ NUdf::TUnboxedValuePod TBlockFuncNode::DoCalculate(TComputationContext& ctx) con      while (dechunker.Next(chunk)) {          auto executor = arrow::compute::detail::KernelExecutor::MakeScalar(); -        ARROW_OK(executor->Init(&state.KernelContext, { &Kernel, ArgsValuesDescr, Options })); +        ARROW_OK(executor->Init(&state.KernelContext, { &Kernel_, ArgsValuesDescr_, Options_ }));          arrow::compute::detail::DatumAccumulator listener;          ARROW_OK(executor->Execute(chunk, &listener)); @@ -303,15 +303,15 @@ NUdf::TUnboxedValuePod TBlockFuncNode::DoCalculate(TComputationContext& ctx) con  void TBlockFuncNode::RegisterDependencies() const { -    for (const auto& arg : ArgsNodes) { +    for (const auto& arg : ArgsNodes_) {          DependsOn(arg);      }  }  TBlockFuncNode::TState& TBlockFuncNode::GetState(TComputationContext& ctx) const { -    auto& result = ctx.MutableValues[StateIndex]; +    auto& result = ctx.MutableValues[StateIndex_];      if (!result.HasValue()) { -        result = ctx.HolderFactory.Create<TState>(Options, Kernel, ArgsValuesDescr, ctx); +        result = ctx.HolderFactory.Create<TState>(Options_, Kernel_, ArgsValuesDescr_, ctx);      }      return *static_cast<TState*>(result.AsBoxed().Get()); @@ -326,28 +326,28 @@ TBlockFuncNode::TArrowNode::TArrowNode(const TBlockFuncNode* parent)  {}  TStringBuf TBlockFuncNode::TArrowNode::GetKernelName() const { -    return Parent_->Name; +    return Parent_->Name_;  }  const arrow::compute::ScalarKernel& TBlockFuncNode::TArrowNode::GetArrowKernel() const { -    return Parent_->Kernel; +    return Parent_->Kernel_;  }  const std::vector<arrow::ValueDescr>& TBlockFuncNode::TArrowNode::GetArgsDesc() const { -    return Parent_->ArgsValuesDescr; +    return Parent_->ArgsValuesDescr_;  }  const IComputationNode* TBlockFuncNode::TArrowNode::GetArgument(ui32 index) const { -    MKQL_ENSURE(index < Parent_->ArgsNodes.size(), "Wrong index"); -    return Parent_->ArgsNodes[index]; +    MKQL_ENSURE(index < Parent_->ArgsNodes_.size(), "Wrong index"); +    return Parent_->ArgsNodes_[index];  }  TBlockState::TBlockState(TMemoryUsageInfo* memInfo, size_t width, i64 blockLengthIndex)      : TBase(memInfo), Values(width), Deques(width), Arrays(width) -    , BlockLengthIndex_(blockLengthIndex == LAST_COLUMN_MARKER ? width - 1 : blockLengthIndex) +    , BlockLengthIndex(blockLengthIndex == LAST_COLUMN_MARKER ? width - 1 : blockLengthIndex)  {      MKQL_ENSURE(blockLengthIndex == LAST_COLUMN_MARKER || (0 <= blockLengthIndex && size_t(blockLengthIndex) < width), "Bad blockLengthIndex"); -    Pointer_ = Values.data(); +    Pointer = Values.data();  }  void TBlockState::ClearValues() { @@ -356,14 +356,14 @@ void TBlockState::ClearValues() {  void TBlockState::FillArrays() {      MKQL_ENSURE(Count == 0, "All existing arrays have to be processed"); -    auto& counterDatum = TArrowBlock::From(Values[BlockLengthIndex_]).GetDatum(); +    auto& counterDatum = TArrowBlock::From(Values[BlockLengthIndex]).GetDatum();      MKQL_ENSURE(counterDatum.is_scalar(), "Unexpected block length type (expecting scalar)");      Count = counterDatum.scalar_as<arrow::UInt64Scalar>().value;      if (!Count)          return;      for (size_t i = 0U; i < Deques.size(); ++i) { -        if (i == BlockLengthIndex_) { +        if (i == BlockLengthIndex) {              continue;          } @@ -409,7 +409,7 @@ ui64 TBlockState::Slice() {  }  NUdf::TUnboxedValuePod TBlockState::Get(const ui64 sliceSize, const THolderFactory& holderFactory, const size_t idx) const { -    if (idx == BlockLengthIndex_) +    if (idx == BlockLengthIndex)          return holderFactory.CreateArrowBlock(arrow::Datum(std::make_shared<arrow::UInt64Scalar>(sliceSize)));      if (auto array = Arrays[idx]) diff --git a/yql/essentials/minikql/computation/mkql_block_impl.h b/yql/essentials/minikql/computation/mkql_block_impl.h index 61964c030e0..4bcdc9514fb 100644 --- a/yql/essentials/minikql/computation/mkql_block_impl.h +++ b/yql/essentials/minikql/computation/mkql_block_impl.h @@ -79,14 +79,14 @@ private:      std::unique_ptr<IArrowKernelComputationNode> PrepareArrowKernelComputationNode(TComputationContext& ctx) const final;  private: -    const ui32 StateIndex; -    const TComputationNodePtrVector ArgsNodes; -    const std::vector<arrow::ValueDescr> ArgsValuesDescr; -    const arrow::compute::ScalarKernel& Kernel; -    const std::shared_ptr<arrow::compute::ScalarKernel> KernelHolder; -    const arrow::compute::FunctionOptions* const Options; -    const bool ScalarOutput; -    const TString Name; +    const ui32 StateIndex_; +    const TComputationNodePtrVector ArgsNodes_; +    const std::vector<arrow::ValueDescr> ArgsValuesDescr_; +    const arrow::compute::ScalarKernel& Kernel_; +    const std::shared_ptr<arrow::compute::ScalarKernel> KernelHolder_; +    const arrow::compute::FunctionOptions* const Options_; +    const bool ScalarOutput_; +    const TString Name_;  };  struct TBlockState : public TComputationValue<TBlockState> { @@ -95,13 +95,13 @@ struct TBlockState : public TComputationValue<TBlockState> {      using TBase = TComputationValue<TBlockState>;      ui64 Count = 0; -    NUdf::TUnboxedValue* Pointer_ = nullptr; +    NUdf::TUnboxedValue* Pointer = nullptr;      TUnboxedValueVector Values;      std::vector<std::deque<std::shared_ptr<arrow::ArrayData>>> Deques;      std::vector<std::shared_ptr<arrow::ArrayData>> Arrays; -    ui64 BlockLengthIndex_ = 0; +    ui64 BlockLengthIndex = 0;      TBlockState(TMemoryUsageInfo* memInfo, size_t width, i64 blockLengthIndex = LAST_COLUMN_MARKER); diff --git a/yql/essentials/minikql/computation/mkql_block_reader.cpp b/yql/essentials/minikql/computation/mkql_block_reader.cpp index 5886e121c40..9104c6e70ed 100644 --- a/yql/essentials/minikql/computation/mkql_block_reader.cpp +++ b/yql/essentials/minikql/computation/mkql_block_reader.cpp @@ -108,9 +108,9 @@ class TStringBlockItemConverter : public IBlockItemConverter {  public:      void SetPgBuilder(const NUdf::IPgBuilder* pgBuilder, ui32 pgTypeId, i32 typeLen) {          Y_ENSURE(PgString != NUdf::EPgStringType::None); -        PgBuilder = pgBuilder; -        PgTypeId = pgTypeId; -        TypeLen = typeLen; +        PgBuilder_ = pgBuilder; +        PgTypeId_ = pgTypeId; +        TypeLen_ = typeLen;      }      NUdf::TUnboxedValuePod MakeValue(TBlockItem item, const THolderFactory& holderFactory) const final { @@ -122,14 +122,14 @@ public:          }          if constexpr (PgString == NUdf::EPgStringType::CString) { -             return PgBuilder->MakeCString(item.AsStringRef().Data() + sizeof(void*)).Release(); +             return PgBuilder_->MakeCString(item.AsStringRef().Data() + sizeof(void*)).Release();          } else if constexpr (PgString == NUdf::EPgStringType::Text) { -             return PgBuilder->MakeText(item.AsStringRef().Data() + sizeof(void*)).Release(); +             return PgBuilder_->MakeText(item.AsStringRef().Data() + sizeof(void*)).Release();          } else if constexpr (PgString == NUdf::EPgStringType::Fixed) {              auto str = item.AsStringRef().Data() + sizeof(void*);              auto len = item.AsStringRef().Size() - sizeof(void*); -            Y_DEBUG_ABORT_UNLESS(ui32(TypeLen) <= len); -            return PgBuilder->NewString(TypeLen, PgTypeId, NUdf::TStringRef(str, TypeLen)).Release(); +            Y_DEBUG_ABORT_UNLESS(ui32(TypeLen_) <= len); +            return PgBuilder_->NewString(TypeLen_, PgTypeId_, NUdf::TStringRef(str, TypeLen_)).Release();          } else {              return MakeString(item.AsStringRef());          } @@ -143,13 +143,13 @@ public:          }          if constexpr (PgString == NUdf::EPgStringType::CString) { -            auto buf = PgBuilder->AsCStringBuffer(value); +            auto buf = PgBuilder_->AsCStringBuffer(value);              return TBlockItem(NYql::NUdf::TStringRef(buf.Data() - sizeof(void*), buf.Size() + sizeof(void*)));          } else if constexpr (PgString == NUdf::EPgStringType::Text) { -            auto buf = PgBuilder->AsTextBuffer(value); +            auto buf = PgBuilder_->AsTextBuffer(value);              return TBlockItem(NYql::NUdf::TStringRef(buf.Data() - sizeof(void*), buf.Size() + sizeof(void*)));          } else if constexpr (PgString == NUdf::EPgStringType::Fixed) { -            auto buf = PgBuilder->AsFixedStringBuffer(value, (ui32)TypeLen); +            auto buf = PgBuilder_->AsFixedStringBuffer(value, (ui32)TypeLen_);              return TBlockItem(NYql::NUdf::TStringRef(buf.Data() - sizeof(void*), buf.Size() + sizeof(void*)));          } else {              return TBlockItem(value.AsStringRef()); @@ -157,9 +157,9 @@ public:      }  private: -    const NUdf::IPgBuilder* PgBuilder = nullptr; -    ui32 PgTypeId = 0; -    i32 TypeLen = 0; +    const NUdf::IPgBuilder* PgBuilder_ = nullptr; +    ui32 PgTypeId_ = 0; +    i32 TypeLen_ = 0;  };  class TSingularTypeItemConverter: public IBlockItemConverter { @@ -179,10 +179,10 @@ template <bool Nullable>  class TTupleBlockItemConverter : public IBlockItemConverter {  public:      TTupleBlockItemConverter(TVector<std::unique_ptr<IBlockItemConverter>>&& children) -        : Children(std::move(children)) +        : Children_(std::move(children))      { -        Items.resize(Children.size()); -        Unboxed.resize(Children.size()); +        Items_.resize(Children_.size()); +        Unboxed_.resize(Children_.size());      }      NUdf::TUnboxedValuePod MakeValue(TBlockItem item, const THolderFactory& holderFactory) const final { @@ -193,10 +193,10 @@ public:          }          NUdf::TUnboxedValue* values; -        auto result = holderFactory.CreateDirectArrayHolder(Children.size(), values); +        auto result = holderFactory.CreateDirectArrayHolder(Children_.size(), values);          const TBlockItem* childItems = item.AsTuple(); -        for (ui32 i = 0; i < Children.size(); ++i) { -            values[i] = Children[i]->MakeValue(childItems[i], holderFactory); +        for (ui32 i = 0; i < Children_.size(); ++i) { +            values[i] = Children_[i]->MakeValue(childItems[i], holderFactory);          }          return result; @@ -211,24 +211,24 @@ public:          auto elements = value.GetElements();          if (!elements) { -            for (ui32 i = 0; i < Children.size(); ++i) { -                Unboxed[i] = value.GetElement(i); +            for (ui32 i = 0; i < Children_.size(); ++i) { +                Unboxed_[i] = value.GetElement(i);              } -            elements = Unboxed.data(); +            elements = Unboxed_.data();          } -        for (ui32 i = 0; i < Children.size(); ++i) { -            Items[i] = Children[i]->MakeItem(elements[i]); +        for (ui32 i = 0; i < Children_.size(); ++i) { +            Items_[i] = Children_[i]->MakeItem(elements[i]);          } -        return TBlockItem{ Items.data() }; +        return TBlockItem{ Items_.data() };      }  private: -    const TVector<std::unique_ptr<IBlockItemConverter>> Children; -    mutable TVector<NUdf::TUnboxedValue> Unboxed; -    mutable TVector<TBlockItem> Items; +    const TVector<std::unique_ptr<IBlockItemConverter>> Children_; +    mutable TVector<NUdf::TUnboxedValue> Unboxed_; +    mutable TVector<TBlockItem> Items_;  };  template <typename TTzDate, bool Nullable> @@ -265,14 +265,14 @@ public:  class TExternalOptionalBlockItemConverter : public IBlockItemConverter {  public:      TExternalOptionalBlockItemConverter(std::unique_ptr<IBlockItemConverter>&& inner) -        : Inner(std::move(inner)) +        : Inner_(std::move(inner))      {}      NUdf::TUnboxedValuePod MakeValue(TBlockItem item, const THolderFactory& holderFactory) const final {          if (!item) {              return {};          } -        return Inner->MakeValue(item.GetOptionalValue(), holderFactory).MakeOptional(); +        return Inner_->MakeValue(item.GetOptionalValue(), holderFactory).MakeOptional();      }      TBlockItem MakeItem(const NUdf::TUnboxedValuePod& value) const final { @@ -280,11 +280,11 @@ public:              return {};          } -        return Inner->MakeItem(value.GetOptionalValue()).MakeOptional(); +        return Inner_->MakeItem(value.GetOptionalValue()).MakeOptional();      }  private: -    const std::unique_ptr<IBlockItemConverter> Inner; +    const std::unique_ptr<IBlockItemConverter> Inner_;  };  struct TConverterTraits { diff --git a/yql/essentials/minikql/computation/mkql_computation_list_adapter.h b/yql/essentials/minikql/computation/mkql_computation_list_adapter.h index 948052d33a2..fe20b91ede9 100644 --- a/yql/essentials/minikql/computation/mkql_computation_list_adapter.h +++ b/yql/essentials/minikql/computation/mkql_computation_list_adapter.h @@ -18,57 +18,57 @@ public:      public:          TIterator(TMemoryUsageInfo* memInfo, const TVectorType& list, TItemFactory itemFactory, ui64 start, ui64 finish, bool reversed)              : TTemporaryComputationValue<TIterator>(memInfo) -            , List(list) -            , ItemFactory(itemFactory) -            , Start(start) -            , Finish(finish) -            , Reversed(reversed) +            , List_(list) +            , ItemFactory_(itemFactory) +            , Start_(start) +            , Finish_(finish) +            , Reversed_(reversed)          { -            Index = Reversed ? Finish : (Start - 1); +            Index_ = Reversed_ ? Finish_ : (Start_ - 1);          }      private:          bool Next(NUdf::TUnboxedValue& value) override {              if (!Skip())                  return false; -            value = ItemFactory(List[Index]); +            value = ItemFactory_(List_[Index_]);              return true;          }          bool Skip() override { -            if (!Reversed) { -                if (Index + 1 >= Finish) +            if (!Reversed_) { +                if (Index_ + 1 >= Finish_)                      return false; -                ++Index; +                ++Index_;              } else { -                if (Index < Start + 1) +                if (Index_ < Start_ + 1)                      return false; -                --Index; +                --Index_;              }              return true;          } -        const TVectorType& List; -        const TItemFactory ItemFactory; -        const ui64 Start; -        const ui64 Finish; -        const bool Reversed; -        ui64 Index; +        const TVectorType& List_; +        const TItemFactory ItemFactory_; +        const ui64 Start_; +        const ui64 Finish_; +        const bool Reversed_; +        ui64 Index_;      };      class TDictIterator : public TTemporaryComputationValue<TDictIterator> {      public:          TDictIterator(TMemoryUsageInfo* memInfo, THolder<TIterator>&& iter)              : TTemporaryComputationValue<TDictIterator>(memInfo) -            , Iter(std::move(iter)) -            , Index(Max<ui64>()) +            , Iter_(std::move(iter)) +            , Index_(Max<ui64>())          {}      private:          bool Next(NUdf::TUnboxedValue& key) override { -            if (NUdf::TBoxedValueAccessor::Skip(*Iter)) { -                key = NUdf::TUnboxedValuePod(++Index); +            if (NUdf::TBoxedValueAccessor::Skip(*Iter_)) { +                key = NUdf::TUnboxedValuePod(++Index_);                  return true;              } @@ -76,8 +76,8 @@ public:          }          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) override { -            if (NUdf::TBoxedValueAccessor::Next(*Iter, payload)) { -                key = NUdf::TUnboxedValuePod(++Index); +            if (NUdf::TBoxedValueAccessor::Next(*Iter_, payload)) { +                key = NUdf::TUnboxedValuePod(++Index_);                  return true;              } @@ -85,16 +85,16 @@ public:          }          bool Skip() override { -            if (NUdf::TBoxedValueAccessor::Skip(*Iter)) { -                ++Index; +            if (NUdf::TBoxedValueAccessor::Skip(*Iter_)) { +                ++Index_;                  return true;              }              return false;          } -        THolder<TIterator> Iter; -        ui64 Index; +        THolder<TIterator> Iter_; +        ui64 Index_;      };      TVectorListAdapter( @@ -104,13 +104,13 @@ public:              ui64 start, ui64 finish,              bool reversed)          : TBase(memInfo) -        , List(list) -        , ItemFactory(itemFactory) -        , Start(start) -        , Finish(finish) -        , Reversed(reversed) +        , List_(list) +        , ItemFactory_(itemFactory) +        , Start_(start) +        , Finish_(finish) +        , Reversed_(reversed)      { -        Y_ABORT_UNLESS(Start <= Finish && Finish <= List.size()); +        Y_ABORT_UNLESS(Start_ <= Finish_ && Finish_ <= List_.size());      }  private: @@ -119,40 +119,40 @@ private:      }      ui64 GetListLength() const override { -        return Finish - Start; +        return Finish_ - Start_;      }      ui64 GetEstimatedListLength() const override { -        return Finish - Start; +        return Finish_ - Start_;      }      bool HasListItems() const override { -        return Finish != Start; +        return Finish_ != Start_;      }      NUdf::IBoxedValuePtr ReverseListImpl(const NUdf::IValueBuilder& builder) const override {          Y_UNUSED(builder); -        return new TSelf(this->GetMemInfo(), List, ItemFactory, Start, Finish, !Reversed); +        return new TSelf(this->GetMemInfo(), List_, ItemFactory_, Start_, Finish_, !Reversed_);      }      NUdf::IBoxedValuePtr SkipListImpl(const NUdf::IValueBuilder& builder, ui64 count) const override {          Y_UNUSED(builder); -        const ui64 newStart = Min(Start + count, Finish); -        if (newStart == Start) { +        const ui64 newStart = Min(Start_ + count, Finish_); +        if (newStart == Start_) {              return const_cast<TVectorListAdapter*>(this);          } -        return new TSelf(this->GetMemInfo(), List, ItemFactory, newStart, Finish, Reversed); +        return new TSelf(this->GetMemInfo(), List_, ItemFactory_, newStart, Finish_, Reversed_);      }      NUdf::IBoxedValuePtr TakeListImpl(const NUdf::IValueBuilder& builder, ui64 count) const override {          Y_UNUSED(builder); -        const ui64 newFinish = Min(Start + count, Finish); -        if (newFinish == Finish) { +        const ui64 newFinish = Min(Start_ + count, Finish_); +        if (newFinish == Finish_) {              return const_cast<TVectorListAdapter*>(this);          } -        return new TSelf(this->GetMemInfo(), List, ItemFactory, Start, newFinish, Reversed); +        return new TSelf(this->GetMemInfo(), List_, ItemFactory_, Start_, newFinish, Reversed_);      }      NUdf::IBoxedValuePtr ToIndexDictImpl(const NUdf::IValueBuilder& builder) const override { @@ -161,7 +161,7 @@ private:      }      NUdf::TUnboxedValue GetListIterator() const override { -        return NUdf::TUnboxedValuePod(new TIterator(this->GetMemInfo(), List, ItemFactory, Start, Finish, Reversed)); +        return NUdf::TUnboxedValuePod(new TIterator(this->GetMemInfo(), List_, ItemFactory_, Start_, Finish_, Reversed_));      }      bool Contains(const NUdf::TUnboxedValuePod& key) const override { @@ -175,16 +175,16 @@ private:              return NUdf::TUnboxedValuePod();          } -        const ui64 realIndex = Reversed ? (Finish - 1 - index) : (Start + index); -        return ItemFactory(List[realIndex]).Release().MakeOptional(); +        const ui64 realIndex = Reversed_ ? (Finish_ - 1 - index) : (Start_ + index); +        return ItemFactory_(List_[realIndex]).Release().MakeOptional();      }      NUdf::TUnboxedValue GetKeysIterator() const override { -        return NUdf::TUnboxedValuePod(new TDictIterator(this->GetMemInfo(), MakeHolder<TIterator>(this->GetMemInfo(), List, ItemFactory, Start, Finish, Reversed))); +        return NUdf::TUnboxedValuePod(new TDictIterator(this->GetMemInfo(), MakeHolder<TIterator>(this->GetMemInfo(), List_, ItemFactory_, Start_, Finish_, Reversed_)));      }      NUdf::TUnboxedValue GetDictIterator() const override { -        return NUdf::TUnboxedValuePod(new TDictIterator(this->GetMemInfo(), MakeHolder<TIterator>(this->GetMemInfo(), List, ItemFactory, Start, Finish, Reversed))); +        return NUdf::TUnboxedValuePod(new TDictIterator(this->GetMemInfo(), MakeHolder<TIterator>(this->GetMemInfo(), List_, ItemFactory_, Start_, Finish_, Reversed_)));      }      ui64 GetDictLength() const override { @@ -192,7 +192,7 @@ private:      }      bool HasDictItems() const override { -        return Finish != Start; +        return Finish_ != Start_;      }      bool IsSortedDict() const override { @@ -200,11 +200,11 @@ private:      }  private: -    const TVectorType& List; -    const TItemFactory ItemFactory; -    const ui64 Start; -    const ui64 Finish; -    const bool Reversed; +    const TVectorType& List_; +    const TItemFactory ItemFactory_; +    const ui64 Start_; +    const ui64 Finish_; +    const bool Reversed_;  };  template <typename TVectorType> diff --git a/yql/essentials/minikql/computation/mkql_computation_node.cpp b/yql/essentials/minikql/computation/mkql_computation_node.cpp index 6625d3a6eef..a8c898d82dd 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node.cpp @@ -70,14 +70,14 @@ TComputationContext::TComputationContext(const THolderFactory& holderFactory,          }      } -    RssLogger = MakeLogger(); -    RssLoggerComponent = RssLogger->RegisterComponent("TrackRss"); +    RssLogger_ = MakeLogger(); +    RssLoggerComponent_ = RssLogger_->RegisterComponent("TrackRss");  }  TComputationContext::~TComputationContext() {  #ifndef NDEBUG      if (RssCounter) { -        RssLogger->Log(RssLoggerComponent, NUdf::ELogLevel::Info, TStringBuilder() +        RssLogger_->Log(RssLoggerComponent_, NUdf::ELogLevel::Info, TStringBuilder()              << "UsageOnFinish: graph=" << HolderFactory.GetPagePool().GetUsed()              << ", rss=" << TRusage::Get().MaxRss              << ", peakAlloc=" << HolderFactory.GetPagePool().GetPeakAllocated() @@ -92,20 +92,20 @@ NUdf::TLoggerPtr TComputationContext::MakeLogger() const {  void TComputationContext::UpdateUsageAdjustor(ui64 memLimit) {      const auto rss = TRusage::Get().MaxRss; -    if (!InitRss) { -        LastRss = InitRss = rss; +    if (!InitRss_) { +        LastRss_ = InitRss_ = rss;      }  #ifndef NDEBUG      // Print first time and then each 30 seconds -    bool printUsage = LastPrintUsage == TInstant::Zero() -        || TInstant::Now() > TDuration::Seconds(30).ToDeadLine(LastPrintUsage); +    bool printUsage = LastPrintUsage_ == TInstant::Zero() +        || TInstant::Now() > TDuration::Seconds(30).ToDeadLine(LastPrintUsage_);  #endif      if (auto peakAlloc = HolderFactory.GetPagePool().GetPeakAllocated()) { -        if (rss - InitRss > memLimit && rss - LastRss > (memLimit / 4)) { -            UsageAdjustor = std::max(1.f, float(rss - InitRss) / float(peakAlloc)); -            LastRss = rss; +        if (rss - InitRss_ > memLimit && rss - LastRss_ > (memLimit / 4)) { +            UsageAdjustor = std::max(1.f, float(rss - InitRss_) / float(peakAlloc)); +            LastRss_ = rss;  #ifndef NDEBUG              printUsage = UsageAdjustor > 1.f;  #endif @@ -114,12 +114,12 @@ void TComputationContext::UpdateUsageAdjustor(ui64 memLimit) {  #ifndef NDEBUG      if (printUsage) { -        RssLogger->Log(RssLoggerComponent, NUdf::ELogLevel::Info, TStringBuilder() +        RssLogger_->Log(RssLoggerComponent_, NUdf::ELogLevel::Info, TStringBuilder()              << "Usage: graph=" << HolderFactory.GetPagePool().GetUsed()              << ", rss=" << rss              << ", peakAlloc=" << HolderFactory.GetPagePool().GetPeakAllocated()              << ", adjustor=" << UsageAdjustor); -        LastPrintUsage = TInstant::Now(); +        LastPrintUsage_ = TInstant::Now();      }  #endif  } @@ -127,11 +127,11 @@ void TComputationContext::UpdateUsageAdjustor(ui64 memLimit) {  class TSimpleSecureParamsProvider : public NUdf::ISecureParamsProvider {  public:      TSimpleSecureParamsProvider(const THashMap<TString, TString>& secureParams) -        : SecureParams(secureParams) +        : SecureParams_(secureParams)      {}      bool GetSecureParam(NUdf::TStringRef key, NUdf::TStringRef& value) const override { -        auto found = SecureParams.FindPtr(TStringBuf(key)); +        auto found = SecureParams_.FindPtr(TStringBuf(key));          if (!found) {              return false;          } @@ -141,7 +141,7 @@ public:      }  private: -    const THashMap<TString, TString> SecureParams; +    const THashMap<TString, TString> SecureParams_;  };  std::unique_ptr<NUdf::ISecureParamsProvider> MakeSimpleSecureParamsProvider(const THashMap<TString, TString>& secureParams) { diff --git a/yql/essentials/minikql/computation/mkql_computation_node.h b/yql/essentials/minikql/computation/mkql_computation_node.h index b1004629394..741d77371ce 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node.h +++ b/yql/essentials/minikql/computation/mkql_computation_node.h @@ -142,12 +142,12 @@ struct TComputationContext : public TComputationContextLLVM {      void UpdateUsageAdjustor(ui64 memLimit);      NUdf::TLoggerPtr MakeLogger() const;  private: -    ui64 InitRss = 0ULL; -    ui64 LastRss = 0ULL; -    NUdf::TLoggerPtr RssLogger; -    NUdf::TLogComponentId RssLoggerComponent; +    ui64 InitRss_ = 0ULL; +    ui64 LastRss_ = 0ULL; +    NUdf::TLoggerPtr RssLogger_; +    NUdf::TLogComponentId RssLoggerComponent_;  #ifndef NDEBUG -    TInstant LastPrintUsage; +    TInstant LastPrintUsage_;  #endif  }; diff --git a/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp b/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp index 72d1c5abfe1..e0bbb759c2e 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp @@ -1008,7 +1008,7 @@ TUnboxedImmutableCodegeneratorNode::TUnboxedImmutableCodegeneratorNode(TMemoryUs  {}  Value* TUnboxedImmutableCodegeneratorNode::CreateGetValue(const TCodegenContext& ctx, BasicBlock*&) const { -    return ConstantInt::get(Type::getInt128Ty(ctx.Codegen.GetContext()), APInt(128, 2, reinterpret_cast<const uint64_t*>(&UnboxedValue))); +    return ConstantInt::get(Type::getInt128Ty(ctx.Codegen.GetContext()), APInt(128, 2, reinterpret_cast<const uint64_t*>(&UnboxedValue_)));  }  TExternalCodegeneratorNode::TExternalCodegeneratorNode(TComputationMutables& mutables, EValueRepresentation kind) @@ -1123,11 +1123,11 @@ Value* TExternalCodegeneratorNode::CreateGetValue(const TCodegenContext& ctx, Ba          return LoadIfPointer(temporaryValue, itemType, block);      } -    MKQL_ENSURE(!Getter, "Wrong LLVM function generation order."); +    MKQL_ENSURE(!Getter_, "Wrong LLVM function generation order.");      auto& context = ctx.Codegen.GetContext();      const auto indexType = Type::getInt32Ty(context);      const auto valueType = Type::getInt128Ty(context); -    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, ctx.GetMutables(), {ConstantInt::get(indexType, ValueIndex)}, "value_ptr", block); +    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, ctx.GetMutables(), {ConstantInt::get(indexType, ValueIndex_)}, "value_ptr", block);      const auto value = new LoadInst(valueType, valuePtr, "value", block);      return value;  } @@ -1139,7 +1139,7 @@ Value* TExternalCodegeneratorNode::CreateRefValue(const TCodegenContext& ctx, Ba      const auto indexType = Type::getInt32Ty(context);      const auto valueType = Type::getInt128Ty(context);      const auto values = ctx.GetMutables(); -    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, values, {ConstantInt::get(indexType, ValueIndex)}, "value_ptr", block); +    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, values, {ConstantInt::get(indexType, ValueIndex_)}, "value_ptr", block);      return valuePtr;  } @@ -1148,16 +1148,16 @@ void TExternalCodegeneratorNode::CreateSetValue(const TCodegenContext& ctx, Basi      const auto indexType = Type::getInt32Ty(context);      const auto valueType = Type::getInt128Ty(context);      const auto values = ctx.GetMutables(); -    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, values, {ConstantInt::get(indexType, ValueIndex)}, "value_ptr", block); +    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, values, {ConstantInt::get(indexType, ValueIndex_)}, "value_ptr", block);      if (value->getType()->isPointerTy()) { -        ValueUnRef(RepresentationKind, valuePtr, ctx, block); +        ValueUnRef(RepresentationKind_, valuePtr, ctx, block);          const auto load = new LoadInst(valueType, value, "value", block);          new StoreInst(load, valuePtr, block);          new StoreInst(ConstantInt::get(load->getType(), 0), value, block);      } else { -        if (EValueRepresentation::Embedded == RepresentationKind) { +        if (EValueRepresentation::Embedded == RepresentationKind_) {              new StoreInst(value, valuePtr, block);          } else {              const auto load = new LoadInst(valueType, valuePtr, "value", block); @@ -1168,9 +1168,9 @@ void TExternalCodegeneratorNode::CreateSetValue(const TCodegenContext& ctx, Basi              BranchInst::Create(skip, refs, equal, block);              block = refs; -            ValueUnRef(RepresentationKind, valuePtr, ctx, block); +            ValueUnRef(RepresentationKind_, valuePtr, ctx, block);              new StoreInst(value, valuePtr, block); -            ValueAddRef(RepresentationKind, valuePtr, ctx, block); +            ValueAddRef(RepresentationKind_, valuePtr, ctx, block);              BranchInst::Create(skip, block);              block = skip; @@ -1185,16 +1185,16 @@ Value* TExternalCodegeneratorNode::CreateSwapValue(const TCodegenContext& ctx, B      const auto indexType = Type::getInt32Ty(context);      const auto valueType = Type::getInt128Ty(context);      const auto values = ctx.GetMutables(); -    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, values, {ConstantInt::get(indexType, ValueIndex)}, "value_ptr", block); +    const auto valuePtr = GetElementPtrInst::CreateInBounds(valueType, values, {ConstantInt::get(indexType, ValueIndex_)}, "value_ptr", block);      const auto output = new LoadInst(valueType, valuePtr, "output", block); -    ValueRelease(RepresentationKind, output, ctx, block); +    ValueRelease(RepresentationKind_, output, ctx, block);      if (value->getType()->isPointerTy()) {          const auto load = new LoadInst(valueType, value, "load", block);          new StoreInst(load, valuePtr, block);          new StoreInst(ConstantInt::get(load->getType(), 0), value, block);      } else { -        ValueAddRef(RepresentationKind, value, ctx, block); +        ValueAddRef(RepresentationKind_, value, ctx, block);          new StoreInst(value, valuePtr, block);      } @@ -1203,7 +1203,7 @@ Value* TExternalCodegeneratorNode::CreateSwapValue(const TCodegenContext& ctx, B  }  void TExternalCodegeneratorNode::CreateInvalidate(const TCodegenContext& ctx, BasicBlock*& block) const { -    GenInvalidate(ctx, InvalidationSet, block); +    GenInvalidate(ctx, InvalidationSet_, block);  }  void TExternalCodegeneratorNode::SetValueBuilder(TValueBuilder valueBuilder) @@ -1217,7 +1217,7 @@ void TExternalCodegeneratorNode::SetValueGetterBuilder(TValueGetterBuilder value  }  void TWideFlowProxyCodegeneratorNode::CreateInvalidate(const TCodegenContext& ctx, BasicBlock*& block) const { -    GenInvalidate(ctx, InvalidationSet, block); +    GenInvalidate(ctx, InvalidationSet_, block);  }  void TWideFlowProxyCodegeneratorNode::SetGenerator(TGenerator&& generator) { diff --git a/yql/essentials/minikql/computation/mkql_computation_node_codegen.h.txt b/yql/essentials/minikql/computation/mkql_computation_node_codegen.h.txt index ab330d852b0..d90b41db6eb 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_codegen.h.txt +++ b/yql/essentials/minikql/computation/mkql_computation_node_codegen.h.txt @@ -288,7 +288,7 @@ protected:      {}      Value* CreateGetValue(const TCodegenContext& ctx, BasicBlock*& block) const final { -        return CreateGetValueImpl(this->Node, ctx, block); +        return CreateGetValueImpl(this->Node_, ctx, block);      }  }; @@ -537,7 +537,7 @@ protected:      {}      Value* CreateGetValue(const TCodegenContext& ctx, BasicBlock*& block) const final { -        return CreateGetValueImpl(*this->Stateless, this->GetRepresentation(), this->ValueIndex, MakeName(), ctx, block); +        return CreateGetValueImpl(*this->Stateless_, this->GetRepresentation(), this->ValueIndex_, MakeName(), ctx, block);      }  }; @@ -569,7 +569,7 @@ protected:      {}      Value* CreateGetValue(const TCodegenContext& ctx, BasicBlock*& block) const final { -        return CreateGetValueImpl(*this->Stateless, this->GetRepresentation(), this->ValueIndex, MakeName(), ctx, block); +        return CreateGetValueImpl(*this->Stateless_, this->GetRepresentation(), this->ValueIndex_, MakeName(), ctx, block);      }  }; diff --git a/yql/essentials/minikql/computation/mkql_computation_node_graph_saveload_ut.cpp b/yql/essentials/minikql/computation/mkql_computation_node_graph_saveload_ut.cpp index dc3b20ddcba..1527d598a31 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_graph_saveload_ut.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_graph_saveload_ut.cpp @@ -68,15 +68,15 @@ namespace {      struct TStreamWithYield : public NUdf::TBoxedValue {          TStreamWithYield(const TUnboxedValueVector& items, ui32 yieldPos, ui32 index) -            : Items(items) -            , YieldPos(yieldPos) -            , Index(index) +            : Items_(items) +            , YieldPos_(yieldPos) +            , Index_(index)          {}      private: -        TUnboxedValueVector Items; -        ui32 YieldPos; -        ui32 Index; +        TUnboxedValueVector Items_; +        ui32 YieldPos_; +        ui32 Index_;          ui32 GetTraverseCount() const override {              return 0; @@ -92,13 +92,13 @@ namespace {          }          NUdf::EFetchStatus Fetch(NUdf::TUnboxedValue& result) final { -            if (Index >= Items.size()) { +            if (Index_ >= Items_.size()) {                  return NUdf::EFetchStatus::Finish;              } -            if (Index == YieldPos) { +            if (Index_ == YieldPos_) {                  return NUdf::EFetchStatus::Yield;              } -            result = Items[Index++]; +            result = Items_[Index_++];              return NUdf::EFetchStatus::Ok;          }      }; diff --git a/yql/essentials/minikql/computation/mkql_computation_node_holders.cpp b/yql/essentials/minikql/computation/mkql_computation_node_holders.cpp index ea643142173..a14dec94e5d 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_holders.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_holders.cpp @@ -24,11 +24,11 @@ class TValueDataHolder: public TComputationValue<TValueDataHolder> {  public:      TValueDataHolder(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& value)          : TComputationValue(memInfo) -        , Value(std::move(value)) +        , Value_(std::move(value))      {}  private: -    const NUdf::TUnboxedValue Value; +    const NUdf::TUnboxedValue Value_;  };  class TDirectListHolder: public TComputationValue<TDirectListHolder> { @@ -37,51 +37,51 @@ public:      public:          TIterator(const TDirectListHolder* parent)              : TComputationValue(parent->GetMemInfo()) -            , Parent(const_cast<TDirectListHolder*>(parent)) -            , Iterator(parent->Items) -            , AtStart(true) +            , Parent_(const_cast<TDirectListHolder*>(parent)) +            , Iterator_(parent->Items_) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              } else { -                if (Iterator.AtEnd()) { +                if (Iterator_.AtEnd()) {                      return false;                  } -                Iterator.Next(); +                Iterator_.Next();              } -            return !Iterator.AtEnd(); +            return !Iterator_.AtEnd();          }          bool Next(NUdf::TUnboxedValue& value) override {              if (!Skip())                  return false; -            value = Iterator.Current(); +            value = Iterator_.Current();              return true;          } -        const NUdf::TRefCountedPtr<TDirectListHolder> Parent; -        TDefaultListRepresentation::TIterator Iterator; -        bool AtStart; +        const NUdf::TRefCountedPtr<TDirectListHolder> Parent_; +        TDefaultListRepresentation::TIterator Iterator_; +        bool AtStart_;      };      class TDictIterator: public TComputationValue<TDictIterator> {      public:          TDictIterator(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& iter)              : TComputationValue(memInfo) -            , Iter(std::move(iter)) -            , Index(Max<ui64>()) +            , Iter_(std::move(iter)) +            , Index_(Max<ui64>())          {}      private:          bool Next(NUdf::TUnboxedValue& key) override { -            if (Iter.Skip()) { -                key = NUdf::TUnboxedValuePod(++Index); +            if (Iter_.Skip()) { +                key = NUdf::TUnboxedValuePod(++Index_);                  return true;              } @@ -89,8 +89,8 @@ public:          }          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) override { -            if (Iter.Next(payload)) { -                key = NUdf::TUnboxedValuePod(++Index); +            if (Iter_.Next(payload)) { +                key = NUdf::TUnboxedValuePod(++Index_);                  return true;              } @@ -98,21 +98,21 @@ public:          }          bool Skip() override { -            if (Iter.Skip()) { -                ++Index; +            if (Iter_.Skip()) { +                ++Index_;                  return true;              }              return false;          } -        const NUdf::TUnboxedValue Iter; -        ui64 Index; +        const NUdf::TUnboxedValue Iter_; +        ui64 Index_;      };      TDirectListHolder(TMemoryUsageInfo* memInfo, TDefaultListRepresentation&& items)          : TComputationValue(memInfo) -        , Items(std::move(items)) +        , Items_(std::move(items))      {}  private: @@ -127,7 +127,7 @@ private:              return NUdf::TUnboxedValuePod();          } -        return Items.GetItemByIndex(index).Release().MakeOptional(); +        return Items_.GetItemByIndex(index).Release().MakeOptional();      }      NUdf::TUnboxedValue GetListIterator() const override { @@ -151,30 +151,30 @@ private:      }      ui64 GetListLength() const override { -        return Items.GetLength(); +        return Items_.GetLength();      }      ui64 GetEstimatedListLength() const override { -        return Items.GetLength(); +        return Items_.GetLength();      }      bool HasListItems() const override { -        return Items.GetLength() != 0; +        return Items_.GetLength() != 0;      }      const NUdf::TOpaqueListRepresentation* GetListRepresentation() const override { -        return reinterpret_cast<const NUdf::TOpaqueListRepresentation*>(&Items); +        return reinterpret_cast<const NUdf::TOpaqueListRepresentation*>(&Items_);      }      NUdf::IBoxedValuePtr ReverseListImpl(const NUdf::IValueBuilder& builder) const override { -        switch (Items.GetLength()) { +        switch (Items_.GetLength()) {              case 0U: return builder.NewEmptyList().Release().AsBoxed();              case 1U: return const_cast<TDirectListHolder*>(this);              default: break;          }          TDefaultListRepresentation result; -        for (auto it = Items.GetReverseIterator(); !it.AtEnd(); it.Next()) { +        for (auto it = Items_.GetReverseIterator(); !it.AtEnd(); it.Next()) {              result = result.Append(NUdf::TUnboxedValue(it.Current()));          } @@ -185,10 +185,10 @@ private:          if (count == 0)              return const_cast<TDirectListHolder*>(this); -        if (count >= Items.GetLength()) +        if (count >= Items_.GetLength())              return builder.NewEmptyList().Release().AsBoxed(); -        auto result = Items.SkipFromBegin(static_cast<size_t>(count)); +        auto result = Items_.SkipFromBegin(static_cast<size_t>(count));          return new TDirectListHolder(GetMemInfo(), std::move(result));      } @@ -196,10 +196,10 @@ private:          if (count == 0)              return builder.NewEmptyList().Release().AsBoxed(); -        if (count >= Items.GetLength()) +        if (count >= Items_.GetLength())              return const_cast<TDirectListHolder*>(this); -        auto result = Items.SkipFromEnd(static_cast<size_t>(Items.GetLength() - count)); +        auto result = Items_.SkipFromEnd(static_cast<size_t>(Items_.GetLength() - count));          return new TDirectListHolder(GetMemInfo(), std::move(result));      } @@ -213,22 +213,22 @@ private:      }      bool HasDictItems() const override { -        return Items.GetLength() != 0; +        return Items_.GetLength() != 0;      }      NUdf::TUnboxedValue GetElement(ui32 index) const final { -        return Items.GetItemByIndex(index); +        return Items_.GetItemByIndex(index);      }      const NUdf::TUnboxedValue* GetElements() const final { -        return Items.GetItems(); +        return Items_.GetItems();      }      bool IsSortedDict() const override {          return true;      } -    TDefaultListRepresentation Items; +    TDefaultListRepresentation Items_;  };  template <class TBaseVector> @@ -256,27 +256,27 @@ private:      public:          TValuesIterator(const TVectorHolderBase* parent)              : TBase(parent->GetMemInfo()) -            , Size(parent->size()) -            , Parent(const_cast<TVectorHolderBase*>(parent)) { +            , Size_(parent->size()) +            , Parent_(const_cast<TVectorHolderBase*>(parent)) {          }      private:          bool Skip() final { -            return ++Current < Size; +            return ++Current_ < Size_;          }          bool Next(NUdf::TUnboxedValue& value) final { -            if (Size <= Current) { +            if (Size_ <= Current_) {                  return false;              } -            value = (*Parent)[Current]; -            ++Current; +            value = (*Parent_)[Current_]; +            ++Current_;              return true;          } -        const size_t Size; -        ui64 Current = 0; -        const NUdf::TRefCountedPtr<TVectorHolderBase> Parent; +        const size_t Size_; +        ui64 Current_ = 0; +        const NUdf::TRefCountedPtr<TVectorHolderBase> Parent_;      };      class TDictIterator: public TTemporaryComputationValue<TDictIterator> { @@ -285,36 +285,36 @@ private:      public:          TDictIterator(const TVectorHolderBase* parent)              : TBase(parent->GetMemInfo()) -            , Size(parent->size()) -            , Parent(const_cast<TVectorHolderBase*>(parent)) { +            , Size_(parent->size()) +            , Parent_(const_cast<TVectorHolderBase*>(parent)) {          }      private:          bool Skip() final { -            return ++Current < Size; +            return ++Current_ < Size_;          }          bool Next(NUdf::TUnboxedValue& key) final { -            if (Current == Size) { +            if (Current_ == Size_) {                  return false;              } -            key = NUdf::TUnboxedValuePod(Current); -            ++Current; +            key = NUdf::TUnboxedValuePod(Current_); +            ++Current_;              return true;          }          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) final { -            if (Current == Size) { +            if (Current_ == Size_) {                  return false;              } -            key = NUdf::TUnboxedValuePod(Current); -            payload = (*Parent)[Current]; -            ++Current; +            key = NUdf::TUnboxedValuePod(Current_); +            payload = (*Parent_)[Current_]; +            ++Current_;              return true;          } -        const size_t Size; -        ui64 Current = 0; -        const NUdf::TRefCountedPtr<TVectorHolderBase> Parent; +        const size_t Size_; +        ui64 Current_ = 0; +        const NUdf::TRefCountedPtr<TVectorHolderBase> Parent_;      };      bool HasListItems() const final { @@ -431,7 +431,7 @@ public:  class TEmptyContainerHolder: public TComputationValue<TEmptyContainerHolder> {  public:      TEmptyContainerHolder(TMemoryUsageInfo* memInfo) -        : TComputationValue(memInfo), None() +        : TComputationValue(memInfo), None_()      {}  private: @@ -440,7 +440,7 @@ private:      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod&) const override { -        return None; +        return None_;      }      NUdf::EFetchStatus Fetch(NUdf::TUnboxedValue&) override { @@ -476,7 +476,7 @@ private:      }      const NUdf::TOpaqueListRepresentation* GetListRepresentation() const override { -        return reinterpret_cast<const NUdf::TOpaqueListRepresentation*>(&List); +        return reinterpret_cast<const NUdf::TOpaqueListRepresentation*>(&List_);      }      bool HasFastListLength() const override { @@ -530,11 +530,11 @@ private:      }      const NUdf::TUnboxedValue* GetElements() const override { -        return &None; +        return &None_;      } -    const NUdf::TUnboxedValue None; -    const TDefaultListRepresentation List; +    const NUdf::TUnboxedValue None_; +    const TDefaultListRepresentation List_;  };  class TSortedSetHolder: public TComputationValue<TSortedSetHolder> { @@ -546,33 +546,33 @@ public:      public:          TIterator(const TSortedSetHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<TSortedSetHolder*>(parent)) -            , Iterator(Parent->Items.begin()) -            , AtStart(true) +            , Parent_(const_cast<TSortedSetHolder*>(parent)) +            , Iterator_(Parent_->Items_.begin()) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              } else { -                if (Iterator == Parent->Items.end()) +                if (Iterator_ == Parent_->Items_.end())                      return false; -                ++Iterator; +                ++Iterator_;              } -           return Iterator != Parent->Items.end(); +           return Iterator_ != Parent_->Items_.end();          }          bool Next(NUdf::TUnboxedValue& key) override {              if (!Skip())                  return false;              if (NoSwap) { -                key = *Iterator; -                if (Parent->Packer) { -                    key = Parent->Packer->Decode(key.AsStringRef(), false, Parent->HolderFactory); +                key = *Iterator_; +                if (Parent_->Packer_) { +                    key = Parent_->Packer_->Decode(key.AsStringRef(), false, Parent_->HolderFactory_);                  }              } else {                  key = NUdf::TUnboxedValuePod::Void(); @@ -586,17 +586,17 @@ public:             if (NoSwap) {                 payload = NUdf::TUnboxedValuePod::Void();             } else { -                payload = *Iterator; -                if (Parent->Packer) { -                    payload = Parent->Packer->Decode(payload.AsStringRef(), false, Parent->HolderFactory); +                payload = *Iterator_; +                if (Parent_->Packer_) { +                    payload = Parent_->Packer_->Decode(payload.AsStringRef(), false, Parent_->HolderFactory_);                  }             }             return true;          } -        const NUdf::TRefCountedPtr<TSortedSetHolder> Parent; -        TItems::const_iterator Iterator; -        bool AtStart; +        const NUdf::TRefCountedPtr<TSortedSetHolder> Parent_; +        TItems::const_iterator Iterator_; +        bool AtStart_;      };      TSortedSetHolder( @@ -611,17 +611,17 @@ public:              const NUdf::IEquate* equate,              const THolderFactory& holderFactory)          : TComputationValue(memInfo) -        , Filler(filler) -        , Types(types) -        , IsTuple(isTuple) -        , Mode(mode) -        , Compare(compare) -        , Equate(equate) -        , IsBuilt(false) -        , HolderFactory(holderFactory) +        , Filler_(filler) +        , Types_(types) +        , IsTuple_(isTuple) +        , Mode_(mode) +        , Compare_(compare) +        , Equate_(equate) +        , IsBuilt_(false) +        , HolderFactory_(holderFactory)      {          if (encodedType) { -            Packer.emplace(encodedType); +            Packer_.emplace(encodedType);          }          if (eagerFill) @@ -629,30 +629,30 @@ public:      }      ~TSortedSetHolder() { -        MKQL_MEM_RETURN(GetMemInfo(), &Items, Items.capacity() * sizeof(TItems::value_type)); +        MKQL_MEM_RETURN(GetMemInfo(), &Items_, Items_.capacity() * sizeof(TItems::value_type));      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Encode(key, false)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Encode(key, false));          } -        return BinarySearch(Items.begin(), Items.end(), NUdf::TUnboxedValuePod(Packer ? encodedKey : key), -            TValueLess(Types, IsTuple, Compare)); +        return BinarySearch(Items_.begin(), Items_.end(), NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key), +            TValueLess(Types_, IsTuple_, Compare_));      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Encode(key, false)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Encode(key, false));          } -        const auto it = LowerBound(Items.begin(), Items.end(), NUdf::TUnboxedValuePod(Packer ? encodedKey : key), TValueLess(Types, IsTuple, Compare)); -        if (it == Items.end() || !TValueEqual(Types, IsTuple, Equate)(*it, NUdf::TUnboxedValuePod(Packer ? encodedKey : key))) +        const auto it = LowerBound(Items_.begin(), Items_.end(), NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key), TValueLess(Types_, IsTuple_, Compare_)); +        if (it == Items_.end() || !TValueEqual(Types_, IsTuple_, Equate_)(*it, NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key)))              return NUdf::TUnboxedValuePod();          return it->MakeOptional(); @@ -675,47 +675,47 @@ private:      ui64 GetDictLength() const override {          LazyBuildDict(); -        return Items.size(); +        return Items_.size();      }      bool HasDictItems() const override {          LazyBuildDict(); -        return !Items.empty(); +        return !Items_.empty();      }      void LazyBuildDict() const { -        if (IsBuilt) +        if (IsBuilt_)              return; -        Filler(Items); -        Filler = TSortedSetFiller(); +        Filler_(Items_); +        Filler_ = TSortedSetFiller(); -        switch (Mode) { +        switch (Mode_) {          case EDictSortMode::RequiresSorting: -            StableSort(Items.begin(), Items.end(), TValueLess(Types, IsTuple, Compare)); -            Items.erase(Unique(Items.begin(), Items.end(), TValueEqual(Types, IsTuple, Equate)), Items.end()); +            StableSort(Items_.begin(), Items_.end(), TValueLess(Types_, IsTuple_, Compare_)); +            Items_.erase(Unique(Items_.begin(), Items_.end(), TValueEqual(Types_, IsTuple_, Equate_)), Items_.end());              break;          case EDictSortMode::SortedUniqueAscending:              break;          case EDictSortMode::SortedUniqueDescening: -            Reverse(Items.begin(), Items.end()); +            Reverse(Items_.begin(), Items_.end());              break;          default:              Y_ABORT();          }          Y_DEBUG_ABORT_UNLESS(IsSortedUnique()); -        IsBuilt = true; +        IsBuilt_ = true; -        if (!Items.empty()) { -            MKQL_MEM_TAKE(GetMemInfo(), &Items, Items.capacity() * sizeof(TItems::value_type)); +        if (!Items_.empty()) { +            MKQL_MEM_TAKE(GetMemInfo(), &Items_, Items_.capacity() * sizeof(TItems::value_type));          }      }      bool IsSortedUnique() const { -        TValueLess less(Types, IsTuple, Compare); -        for (size_t i = 1, e = Items.size(); i < e; ++i) { -            if (!less(Items[i - 1], Items[i])) +        TValueLess less(Types_, IsTuple_, Compare_); +        for (size_t i = 1, e = Items_.size(); i < e; ++i) { +            if (!less(Items_[i - 1], Items_[i]))                  return false;          } @@ -727,16 +727,16 @@ private:      }  private: -    mutable TSortedSetFiller Filler; -    const TKeyTypes Types; -    const bool IsTuple; -    const EDictSortMode Mode; -    const NUdf::ICompare* Compare; -    const NUdf::IEquate* Equate; -    mutable bool IsBuilt; -    const THolderFactory& HolderFactory; -    mutable TItems Items; -    mutable std::optional<TGenericPresortEncoder> Packer; +    mutable TSortedSetFiller Filler_; +    const TKeyTypes Types_; +    const bool IsTuple_; +    const EDictSortMode Mode_; +    const NUdf::ICompare* Compare_; +    const NUdf::IEquate* Equate_; +    mutable bool IsBuilt_; +    const THolderFactory& HolderFactory_; +    mutable TItems Items_; +    mutable std::optional<TGenericPresortEncoder> Packer_;  };  class TSortedDictHolder: public TComputationValue<TSortedDictHolder> { @@ -748,36 +748,36 @@ public:      public:          TIterator(const TSortedDictHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<TSortedDictHolder*>(parent)) -            , Iterator(Parent->Items.begin()) -            , AtStart(true) +            , Parent_(const_cast<TSortedDictHolder*>(parent)) +            , Iterator_(Parent_->Items_.begin()) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              } else { -                if (Iterator == Parent->Items.end()) +                if (Iterator_ == Parent_->Items_.end())                      return false; -                ++Iterator; +                ++Iterator_;              } -           return Iterator != Parent->Items.end(); +           return Iterator_ != Parent_->Items_.end();          }          bool Next(NUdf::TUnboxedValue& key) override {              if (!Skip())                  return false;              if (NoSwap) { -                key = Iterator->first; -                if (Parent->Packer) { -                    key = Parent->Packer->Decode(key.AsStringRef(), false, Parent->HolderFactory); +                key = Iterator_->first; +                if (Parent_->Packer_) { +                    key = Parent_->Packer_->Decode(key.AsStringRef(), false, Parent_->HolderFactory_);                  }              } else { -                key = Iterator->second; +                key = Iterator_->second;              }              return true;          } @@ -786,19 +786,19 @@ public:             if (!Next(key))                 return false;             if (NoSwap) { -               payload = Iterator->second; +               payload = Iterator_->second;             } else { -                payload = Iterator->first; -                if (Parent->Packer) { -                    payload = Parent->Packer->Decode(payload.AsStringRef(), false, Parent->HolderFactory); +                payload = Iterator_->first; +                if (Parent_->Packer_) { +                    payload = Parent_->Packer_->Decode(payload.AsStringRef(), false, Parent_->HolderFactory_);                  }             }             return true;          } -        const NUdf::TRefCountedPtr<TSortedDictHolder> Parent; -        TItems::const_iterator Iterator; -        bool AtStart; +        const NUdf::TRefCountedPtr<TSortedDictHolder> Parent_; +        TItems::const_iterator Iterator_; +        bool AtStart_;      };      TSortedDictHolder( @@ -813,17 +813,17 @@ public:              const NUdf::IEquate* equate,              const THolderFactory& holderFactory)          : TComputationValue(memInfo) -        , Filler(filler) -        , Types(types) -        , IsTuple(isTuple) -        , Mode(mode) -        , Compare(compare) -        , Equate(equate) -        , IsBuilt(false) -        , HolderFactory(holderFactory) +        , Filler_(filler) +        , Types_(types) +        , IsTuple_(isTuple) +        , Mode_(mode) +        , Compare_(compare) +        , Equate_(equate) +        , IsBuilt_(false) +        , HolderFactory_(holderFactory)      {          if (encodedType) { -            Packer.emplace(encodedType); +            Packer_.emplace(encodedType);          }          if (eagerFill) @@ -831,30 +831,30 @@ public:      }      ~TSortedDictHolder() { -        MKQL_MEM_RETURN(GetMemInfo(), &Items, Items.capacity() * sizeof(TItems::value_type)); +        MKQL_MEM_RETURN(GetMemInfo(), &Items_, Items_.capacity() * sizeof(TItems::value_type));      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Encode(key, false)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Encode(key, false));          } -        return BinarySearch(Items.begin(), Items.end(), TItems::value_type(NUdf::TUnboxedValuePod(Packer ? encodedKey : key), NUdf::TUnboxedValuePod()), -            TKeyPayloadPairLess(Types, IsTuple, Compare)); +        return BinarySearch(Items_.begin(), Items_.end(), TItems::value_type(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key), NUdf::TUnboxedValuePod()), +            TKeyPayloadPairLess(Types_, IsTuple_, Compare_));      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Encode(key, false)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Encode(key, false));          } -        const auto it = LowerBound(Items.begin(), Items.end(), TItems::value_type(NUdf::TUnboxedValuePod(Packer ? encodedKey : key), NUdf::TUnboxedValue()), TKeyPayloadPairLess(Types, IsTuple, Compare)); -        if (it == Items.end() || !TKeyPayloadPairEqual(Types, IsTuple, Equate)({it->first, it->second}, TKeyPayloadPair(NUdf::TUnboxedValuePod(Packer ? encodedKey : key), {}))) +        const auto it = LowerBound(Items_.begin(), Items_.end(), TItems::value_type(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key), NUdf::TUnboxedValue()), TKeyPayloadPairLess(Types_, IsTuple_, Compare_)); +        if (it == Items_.end() || !TKeyPayloadPairEqual(Types_, IsTuple_, Equate_)({it->first, it->second}, TKeyPayloadPair(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key), {})))              return NUdf::TUnboxedValuePod();          return it->second.MakeOptional(); @@ -877,47 +877,47 @@ private:      ui64 GetDictLength() const override {          LazyBuildDict(); -        return Items.size(); +        return Items_.size();      }      bool HasDictItems() const override {          LazyBuildDict(); -        return !Items.empty(); +        return !Items_.empty();      }      void LazyBuildDict() const { -        if (IsBuilt) +        if (IsBuilt_)              return; -        Filler(Items); -        Filler = TSortedDictFiller(); +        Filler_(Items_); +        Filler_ = TSortedDictFiller(); -        switch (Mode) { +        switch (Mode_) {          case EDictSortMode::RequiresSorting: -            StableSort(Items.begin(), Items.end(), TKeyPayloadPairLess(Types, IsTuple, Compare)); -            Items.erase(Unique(Items.begin(), Items.end(), TKeyPayloadPairEqual(Types, IsTuple, Equate)), Items.end()); +            StableSort(Items_.begin(), Items_.end(), TKeyPayloadPairLess(Types_, IsTuple_, Compare_)); +            Items_.erase(Unique(Items_.begin(), Items_.end(), TKeyPayloadPairEqual(Types_, IsTuple_, Equate_)), Items_.end());              break;          case EDictSortMode::SortedUniqueAscending:              break;          case EDictSortMode::SortedUniqueDescening: -            Reverse(Items.begin(), Items.end()); +            Reverse(Items_.begin(), Items_.end());              break;          default:              Y_ABORT();          }          Y_DEBUG_ABORT_UNLESS(IsSortedUnique()); -        IsBuilt = true; +        IsBuilt_ = true; -        if (!Items.empty()) { -            MKQL_MEM_TAKE(GetMemInfo(), &Items, Items.capacity() * sizeof(TItems::value_type)); +        if (!Items_.empty()) { +            MKQL_MEM_TAKE(GetMemInfo(), &Items_, Items_.capacity() * sizeof(TItems::value_type));          }      }      bool IsSortedUnique() const { -        TKeyPayloadPairLess less(Types, IsTuple, Compare); -        for (size_t i = 1, e = Items.size(); i < e; ++i) { -            if (!less(Items[i - 1], Items[i])) +        TKeyPayloadPairLess less(Types_, IsTuple_, Compare_); +        for (size_t i = 1, e = Items_.size(); i < e; ++i) { +            if (!less(Items_[i - 1], Items_[i]))                  return false;          } @@ -929,16 +929,16 @@ private:      }  private: -    mutable TSortedDictFiller Filler; -    const TKeyTypes Types; -    const bool IsTuple; -    const EDictSortMode Mode; -    const NUdf::ICompare* Compare; -    const NUdf::IEquate* Equate; -    mutable bool IsBuilt; -    const THolderFactory& HolderFactory; -    mutable TItems Items; -    mutable std::optional<TGenericPresortEncoder> Packer; +    mutable TSortedDictFiller Filler_; +    const TKeyTypes Types_; +    const bool IsTuple_; +    const EDictSortMode Mode_; +    const NUdf::ICompare* Compare_; +    const NUdf::IEquate* Equate_; +    mutable bool IsBuilt_; +    const THolderFactory& HolderFactory_; +    mutable TItems Items_; +    mutable std::optional<TGenericPresortEncoder> Packer_;  };  class THashedSetHolder : public TComputationValue<THashedSetHolder> { @@ -947,35 +947,35 @@ public:      public:          TIterator(const THashedSetHolder* parent)              : TComputationValue(parent->GetMemInfo()) -            , Parent(const_cast<THashedSetHolder*>(parent)) -            , Iterator(Parent->Set.begin()) -            , End(Parent->Set.end()) -            , AtStart(true) +            , Parent_(const_cast<THashedSetHolder*>(parent)) +            , Iterator_(Parent_->Set_.begin()) +            , End_(Parent_->Set_.end()) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              }              else { -                if (Iterator == End) { +                if (Iterator_ == End_) {                      return false;                  } -                ++Iterator; +                ++Iterator_;              } -            return Iterator != End; +            return Iterator_ != End_;          }          bool Next(NUdf::TUnboxedValue& key) override {              if (!Skip())                  return false; -            key = *Iterator; -            if (Parent->Packer) { -                key = Parent->Packer->Unpack(key.AsStringRef(), Parent->HolderFactory); +            key = *Iterator_; +            if (Parent_->Packer_) { +                key = Parent_->Packer_->Unpack(key.AsStringRef(), Parent_->HolderFactory_);              }              return true; @@ -989,24 +989,24 @@ public:          }      private: -        const NUdf::TRefCountedPtr<THashedSetHolder> Parent; -        TValuesDictHashSet::const_iterator Iterator; -        TValuesDictHashSet::const_iterator End; -        bool AtStart; +        const NUdf::TRefCountedPtr<THashedSetHolder> Parent_; +        TValuesDictHashSet::const_iterator Iterator_; +        TValuesDictHashSet::const_iterator End_; +        bool AtStart_;      };      THashedSetHolder(TMemoryUsageInfo* memInfo, THashedSetFiller filler,          const TKeyTypes& types, bool isTuple, bool eagerFill, TType* encodedType,          const NUdf::IHash* hash, const NUdf::IEquate* equate, const THolderFactory& holderFactory)          : TComputationValue(memInfo) -        , Filler(filler) -        , Types(types) -        , Set(0, TValueHasher(Types, isTuple, hash), TValueEqual(Types, isTuple, equate)) -        , IsBuilt(false) -        , HolderFactory(holderFactory) +        , Filler_(filler) +        , Types_(types) +        , Set_(0, TValueHasher(Types_, isTuple, hash), TValueEqual(Types_, isTuple, equate)) +        , IsBuilt_(false) +        , HolderFactory_(holderFactory)      {          if (encodedType) { -            Packer.emplace(true, encodedType); +            Packer_.emplace(true, encodedType);          }          if (eagerFill) @@ -1017,22 +1017,22 @@ private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Pack(key)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Pack(key));          } -        return Set.find(NUdf::TUnboxedValuePod(Packer ? encodedKey : key)) != Set.cend(); +        return Set_.find(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key)) != Set_.cend();      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Pack(key)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Pack(key));          } -        const auto it = Set.find(NUdf::TUnboxedValuePod(Packer ? encodedKey : key)); -        if (it == Set.cend()) +        const auto it = Set_.find(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key)); +        if (it == Set_.cend())              return NUdf::TUnboxedValuePod();          return NUdf::TUnboxedValuePod::Void();      } @@ -1059,12 +1059,12 @@ private:      ui64 GetDictLength() const override {          LazyBuildDict(); -        return Set.size(); +        return Set_.size();      }      bool HasDictItems() const override {          LazyBuildDict(); -        return !Set.empty(); +        return !Set_.empty();      }      bool IsSortedDict() const override { @@ -1073,22 +1073,22 @@ private:  private:      void LazyBuildDict() const { -        if (IsBuilt) +        if (IsBuilt_)              return; -        Filler(Set); -        Filler = THashedSetFiller(); +        Filler_(Set_); +        Filler_ = THashedSetFiller(); -        IsBuilt = true; +        IsBuilt_ = true;      }  private: -    mutable THashedSetFiller Filler; -    const TKeyTypes Types; -    mutable TValuesDictHashSet Set; -    mutable bool IsBuilt; -    const THolderFactory& HolderFactory; -    mutable std::optional<TValuePacker> Packer; +    mutable THashedSetFiller Filler_; +    const TKeyTypes Types_; +    mutable TValuesDictHashSet Set_; +    mutable bool IsBuilt_; +    const THolderFactory& HolderFactory_; +    mutable std::optional<TValuePacker> Packer_;  };  template <typename T, bool OptionalKey> @@ -1105,36 +1105,36 @@ public:          };          TIterator(const THashedSingleFixedSetHolder* parent)              : TComputationValue<TIterator>(parent->GetMemInfo()) -            , Parent(const_cast<THashedSingleFixedSetHolder*>(parent)) -            , Iterator(Parent->Set.begin()) -            , End(Parent->Set.end()) -            , State(EState::AtStart) +            , Parent_(const_cast<THashedSingleFixedSetHolder*>(parent)) +            , Iterator_(Parent_->Set_.begin()) +            , End_(Parent_->Set_.end()) +            , State_(EState::AtStart)          {          }      private:          bool Skip() final { -            switch (State) { +            switch (State_) {              case EState::AtStart: -                State = OptionalKey && Parent->HasNull ? EState::AtNull : EState::Iterator; +                State_ = OptionalKey && Parent_->HasNull_ ? EState::AtNull : EState::Iterator;                  break;              case EState::AtNull: -                State = EState::Iterator; +                State_ = EState::Iterator;                  break;              case EState::Iterator: -                if (Iterator == End) +                if (Iterator_ == End_)                      return false; -                ++Iterator; +                ++Iterator_;                  break;              } -            return EState::AtNull == State || Iterator != End; +            return EState::AtNull == State_ || Iterator_ != End_;          }          bool Next(NUdf::TUnboxedValue& key) final {              if (!Skip())                  return false; -            key = EState::AtNull == State ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(*Iterator); +            key = EState::AtNull == State_ ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(*Iterator_);              return true;          } @@ -1145,28 +1145,28 @@ public:              return true;          } -        const NUdf::TRefCountedPtr<THashedSingleFixedSetHolder> Parent; -        typename TSetType::const_iterator Iterator; -        typename TSetType::const_iterator End; -        EState State; +        const NUdf::TRefCountedPtr<THashedSingleFixedSetHolder> Parent_; +        typename TSetType::const_iterator Iterator_; +        typename TSetType::const_iterator End_; +        EState State_;      };      THashedSingleFixedSetHolder(TMemoryUsageInfo* memInfo, TSetType&& set, bool hasNull)          : TComputationValue<THashedSingleFixedSetHolder>(memInfo) -        , Set(std::move(set)) -        , HasNull(hasNull) +        , Set_(std::move(set)) +        , HasNull_(hasNull)      { -        MKQL_ENSURE(OptionalKey || !HasNull, "Null value is not allowed for non-optional key type"); +        MKQL_ENSURE(OptionalKey || !HasNull_, "Null value is not allowed for non-optional key type");      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const final {          if constexpr (OptionalKey) {              if (!key) { -                return HasNull; +                return HasNull_;              }          } -        return Set.find(key.Get<T>()) != Set.cend(); +        return Set_.find(key.Get<T>()) != Set_.cend();      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const final { @@ -1192,19 +1192,19 @@ private:      }      ui64 GetDictLength() const final { -        return Set.size() + ui64(OptionalKey && HasNull); +        return Set_.size() + ui64(OptionalKey && HasNull_);      }      bool HasDictItems() const final { -        return !Set.empty() || (OptionalKey && HasNull); +        return !Set_.empty() || (OptionalKey && HasNull_);      }      bool IsSortedDict() const final {          return false;      } -    const TSetType Set; -    const bool HasNull; +    const TSetType Set_; +    const bool HasNull_;  };  template <typename T, bool OptionalKey> @@ -1221,35 +1221,35 @@ public:          };          TIterator(const THashedSingleFixedCompactSetHolder* parent)              : TComputationValue<TIterator>(parent->GetMemInfo()) -            , Parent(const_cast<THashedSingleFixedCompactSetHolder*>(parent)) -            , Iterator(Parent->Set.Iterate()) -            , State(EState::AtStart) +            , Parent_(const_cast<THashedSingleFixedCompactSetHolder*>(parent)) +            , Iterator_(Parent_->Set_.Iterate()) +            , State_(EState::AtStart)          {          }      private:          bool Skip() final { -            switch (State) { +            switch (State_) {              case EState::AtStart: -                State = OptionalKey && Parent->HasNull ? EState::AtNull : EState::Iterator; +                State_ = OptionalKey && Parent_->HasNull_ ? EState::AtNull : EState::Iterator;                  break;              case EState::AtNull: -                State = EState::Iterator; +                State_ = EState::Iterator;                  break;              case EState::Iterator: -                if (!Iterator.Ok()) +                if (!Iterator_.Ok())                      return false; -                ++Iterator; +                ++Iterator_;                  break;              } -            return EState::AtNull == State || Iterator.Ok(); +            return EState::AtNull == State_ || Iterator_.Ok();          }          bool Next(NUdf::TUnboxedValue& key) final {              if (!Skip())                  return false; -            key = EState::AtNull == State ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(*Iterator); +            key = EState::AtNull == State_ ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(*Iterator_);              return true;          } @@ -1260,27 +1260,27 @@ public:              return true;          } -        const NUdf::TRefCountedPtr<THashedSingleFixedCompactSetHolder> Parent; -        typename TSetType::TIterator Iterator; -        EState State; +        const NUdf::TRefCountedPtr<THashedSingleFixedCompactSetHolder> Parent_; +        typename TSetType::TIterator Iterator_; +        EState State_;      };      THashedSingleFixedCompactSetHolder(TMemoryUsageInfo* memInfo, TSetType&& set, bool hasNull)          : TComputationValue<THashedSingleFixedCompactSetHolder>(memInfo) -        , Set(std::move(set)) -        , HasNull(hasNull) +        , Set_(std::move(set)) +        , HasNull_(hasNull)      { -        MKQL_ENSURE(OptionalKey || !HasNull, "Null value is not allowed for non-optional key type"); +        MKQL_ENSURE(OptionalKey || !HasNull_, "Null value is not allowed for non-optional key type");      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const final {          if constexpr (OptionalKey) {              if (!key) { -                return HasNull; +                return HasNull_;              }          } -        return Set.Has(key.Get<T>()); +        return Set_.Has(key.Get<T>());      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const final { @@ -1306,19 +1306,19 @@ private:      }      ui64 GetDictLength() const final { -        return Set.Size() + ui64(OptionalKey && HasNull); +        return Set_.Size() + ui64(OptionalKey && HasNull_);      }      bool HasDictItems() const final { -        return !Set.Empty() || (OptionalKey && HasNull); +        return !Set_.Empty() || (OptionalKey && HasNull_);      }      bool IsSortedDict() const final {          return false;      } -    const TSetType Set; -    const bool HasNull; +    const TSetType Set_; +    const bool HasNull_;  };  class THashedCompactSetHolder : public TComputationValue<THashedCompactSetHolder> { @@ -1329,30 +1329,30 @@ public:      public:          TIterator(const THashedCompactSetHolder* parent)              : TComputationValue(parent->GetMemInfo()) -            , Parent(const_cast<THashedCompactSetHolder*>(parent)) -            , Iterator(Parent->Set.Iterate()) -            , AtStart(true) +            , Parent_(const_cast<THashedCompactSetHolder*>(parent)) +            , Iterator_(Parent_->Set_.Iterate()) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              }              else { -                if (!Iterator.Ok()) +                if (!Iterator_.Ok())                      return false; -                ++Iterator; +                ++Iterator_;              } -            return Iterator.Ok(); +            return Iterator_.Ok();          }          bool Next(NUdf::TUnboxedValue& key) override {              if (!Skip())                  return false; -            key = Parent->KeyPacker.Unpack(GetSmallValue(*Iterator), Parent->Ctx->HolderFactory); +            key = Parent_->KeyPacker_.Unpack(GetSmallValue(*Iterator_), Parent_->Ctx_->HolderFactory);              return true;          } @@ -1363,31 +1363,31 @@ public:              return true;          } -        const NUdf::TRefCountedPtr<THashedCompactSetHolder> Parent; -        typename TSetType::TIterator Iterator; -        bool AtStart; +        const NUdf::TRefCountedPtr<THashedCompactSetHolder> Parent_; +        typename TSetType::TIterator Iterator_; +        bool AtStart_;      };      THashedCompactSetHolder(TMemoryUsageInfo* memInfo, TSetType&& set, TPagedArena&& pool, TType* keyType, TComputationContext* ctx)          : TComputationValue(memInfo) -        , Pool(std::move(pool)) -        , Set(std::move(set)) -        , KeyPacker(true, keyType) -        , Ctx(ctx) +        , Pool_(std::move(pool)) +        , Set_(std::move(set)) +        , KeyPacker_(true, keyType) +        , Ctx_(ctx)      {      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override { -        auto serializedKey = KeyPacker.Pack(NUdf::TUnboxedValuePod(key)); +        auto serializedKey = KeyPacker_.Pack(NUdf::TUnboxedValuePod(key));          ui64 smallValue = AsSmallValue(serializedKey); -        return Set.Has(smallValue); +        return Set_.Has(smallValue);      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override { -        auto serializedKey = KeyPacker.Pack(NUdf::TUnboxedValuePod(key)); +        auto serializedKey = KeyPacker_.Pack(NUdf::TUnboxedValuePod(key));          ui64 smallValue = AsSmallValue(serializedKey); -        if (Set.Has(smallValue)) +        if (Set_.Has(smallValue))              return NUdf::TUnboxedValuePod::Void();          return NUdf::TUnboxedValuePod();      } @@ -1409,11 +1409,11 @@ private:      }      ui64 GetDictLength() const override { -        return Set.Size(); +        return Set_.Size();      }      bool HasDictItems() const override { -        return !Set.Empty(); +        return !Set_.Empty();      }      bool IsSortedDict() const override { @@ -1421,10 +1421,10 @@ private:      }  private: -    TPagedArena Pool; -    const TSetType Set; -    mutable TValuePacker KeyPacker; -    TComputationContext* Ctx; +    TPagedArena Pool_; +    const TSetType Set_; +    mutable TValuePacker KeyPacker_; +    TComputationContext* Ctx_;  };  class THashedCompactMapHolder : public TComputationValue<THashedCompactMapHolder> { @@ -1436,32 +1436,32 @@ public:      public:          TIterator(const THashedCompactMapHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<THashedCompactMapHolder*>(parent)) -            , Iterator(Parent->Map.Iterate()) -            , AtStart(true) +            , Parent_(const_cast<THashedCompactMapHolder*>(parent)) +            , Iterator_(Parent_->Map_.Iterate()) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              }              else { -                if (!Iterator.Ok()) +                if (!Iterator_.Ok())                      return false; -                ++Iterator; +                ++Iterator_;              } -            return Iterator.Ok(); +            return Iterator_.Ok();          }          bool Next(NUdf::TUnboxedValue& key) override {              if (!Skip())                  return false;              key = NoSwap ? -                Parent->KeyPacker.Unpack(GetSmallValue(Iterator.Get().first), Parent->Ctx->HolderFactory): -                Parent->PayloadPacker.Unpack(GetSmallValue(Iterator.Get().second), Parent->Ctx->HolderFactory); +                Parent_->KeyPacker_.Unpack(GetSmallValue(Iterator_.Get().first), Parent_->Ctx_->HolderFactory): +                Parent_->PayloadPacker_.Unpack(GetSmallValue(Iterator_.Get().second), Parent_->Ctx_->HolderFactory);              return true;          } @@ -1469,41 +1469,41 @@ public:              if (!Next(key))                  return false;              payload = NoSwap ? -                Parent->PayloadPacker.Unpack(GetSmallValue(Iterator.Get().second), Parent->Ctx->HolderFactory): -                Parent->KeyPacker.Unpack(GetSmallValue(Iterator.Get().first), Parent->Ctx->HolderFactory); +                Parent_->PayloadPacker_.Unpack(GetSmallValue(Iterator_.Get().second), Parent_->Ctx_->HolderFactory): +                Parent_->KeyPacker_.Unpack(GetSmallValue(Iterator_.Get().first), Parent_->Ctx_->HolderFactory);              return true;          } -        const NUdf::TRefCountedPtr<THashedCompactMapHolder> Parent; -        typename TMapType::TIterator Iterator; -        bool AtStart; +        const NUdf::TRefCountedPtr<THashedCompactMapHolder> Parent_; +        typename TMapType::TIterator Iterator_; +        bool AtStart_;      };      THashedCompactMapHolder(TMemoryUsageInfo* memInfo, TMapType&& map, TPagedArena&& pool,          TType* keyType, TType* payloadType, TComputationContext* ctx)          : TComputationValue(memInfo) -        , Pool(std::move(pool)) -        , Map(std::move(map)) -        , KeyPacker(true, keyType) -        , PayloadPacker(false, payloadType) -        , Ctx(ctx) +        , Pool_(std::move(pool)) +        , Map_(std::move(map)) +        , KeyPacker_(true, keyType) +        , PayloadPacker_(false, payloadType) +        , Ctx_(ctx)      {      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override { -        auto serializedKey = KeyPacker.Pack(NUdf::TUnboxedValuePod(key)); +        auto serializedKey = KeyPacker_.Pack(NUdf::TUnboxedValuePod(key));          ui64 smallValue = AsSmallValue(serializedKey); -        return Map.Has(smallValue); +        return Map_.Has(smallValue);      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override { -        auto serializedKey = KeyPacker.Pack(NUdf::TUnboxedValuePod(key)); +        auto serializedKey = KeyPacker_.Pack(NUdf::TUnboxedValuePod(key));          ui64 smallValue = AsSmallValue(serializedKey); -        auto it = Map.Find(smallValue); +        auto it = Map_.Find(smallValue);          if (!it.Ok())              return NUdf::TUnboxedValuePod(); -        return PayloadPacker.Unpack(GetSmallValue(it.Get().second), Ctx->HolderFactory).Release().MakeOptional(); +        return PayloadPacker_.Unpack(GetSmallValue(it.Get().second), Ctx_->HolderFactory).Release().MakeOptional();      }      NUdf::TUnboxedValue GetKeysIterator() const override { @@ -1519,22 +1519,22 @@ private:      }      ui64 GetDictLength() const override { -        return Map.Size(); +        return Map_.Size();      }      bool HasDictItems() const override { -        return !Map.Empty(); +        return !Map_.Empty();      }      bool IsSortedDict() const override {          return false;      } -    TPagedArena Pool; -    const TMapType Map; -    mutable TValuePacker KeyPacker; -    mutable TValuePacker PayloadPacker; -    TComputationContext* Ctx; +    TPagedArena Pool_; +    const TMapType Map_; +    mutable TValuePacker KeyPacker_; +    mutable TValuePacker PayloadPacker_; +    TComputationContext* Ctx_;  };  class THashedCompactMultiMapHolder : public TComputationValue<THashedCompactMultiMapHolder> { @@ -1548,41 +1548,41 @@ public:          public:              TIterator(const THashedCompactMultiMapHolder* parent, TMapIterator from)                  : TComputationValue(parent->GetMemInfo()) -                , Parent(const_cast<THashedCompactMultiMapHolder*>(parent)) -                , Iterator(from) +                , Parent_(const_cast<THashedCompactMultiMapHolder*>(parent)) +                , Iterator_(from)              {              }          private:              bool Next(NUdf::TUnboxedValue& value) override { -                if (!Iterator.Ok()) { +                if (!Iterator_.Ok()) {                      return false;                  } -                value = Parent->PayloadPacker.Unpack(GetSmallValue(Iterator.GetValue()), Parent->CompCtx.HolderFactory); -                ++Iterator; +                value = Parent_->PayloadPacker_.Unpack(GetSmallValue(Iterator_.GetValue()), Parent_->CompCtx_.HolderFactory); +                ++Iterator_;                  return true;              }              bool Skip() override { -                if (!Iterator.Ok()) { +                if (!Iterator_.Ok()) {                      return false;                  } -                ++Iterator; +                ++Iterator_;                  return true;              } -            const NUdf::TRefCountedPtr<THashedCompactMultiMapHolder> Parent; -            TMapIterator Iterator; +            const NUdf::TRefCountedPtr<THashedCompactMultiMapHolder> Parent_; +            TMapIterator Iterator_;          };          TPayloadList(TMemoryUsageInfo* memInfo, const THashedCompactMultiMapHolder* parent, TMapIterator from)              : TCustomListValue(memInfo) -            , Parent(const_cast<THashedCompactMultiMapHolder*>(parent)) -            , From(from) +            , Parent_(const_cast<THashedCompactMultiMapHolder*>(parent)) +            , From_(from)          { -            Y_ASSERT(From.Ok()); +            Y_ASSERT(From_.Ok());          }      private: @@ -1591,11 +1591,11 @@ public:          }          ui64 GetListLength() const override { -            if (!Length) { -                Length = Parent->Map.Count(From.GetKey()); +            if (!Length_) { +                Length_ = Parent_->Map_.Count(From_.GetKey());              } -            return *Length; +            return *Length_;          }          bool HasListItems() const override { @@ -1603,11 +1603,11 @@ public:          }          NUdf::TUnboxedValue GetListIterator() const override { -            return NUdf::TUnboxedValuePod(new TIterator(Parent.Get(), From)); +            return NUdf::TUnboxedValuePod(new TIterator(Parent_.Get(), From_));          } -        const NUdf::TRefCountedPtr<THashedCompactMultiMapHolder> Parent; -        TMapIterator From; +        const NUdf::TRefCountedPtr<THashedCompactMultiMapHolder> Parent_; +        TMapIterator From_;      };      template <bool NoSwap> @@ -1615,79 +1615,79 @@ public:      public:          TIterator(const THashedCompactMultiMapHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<THashedCompactMultiMapHolder*>(parent)) -            , Iterator(parent->Map.Iterate()) +            , Parent_(const_cast<THashedCompactMultiMapHolder*>(parent)) +            , Iterator_(parent->Map_.Iterate())          {          }      private:          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) override { -            if (!Iterator.Ok()) { +            if (!Iterator_.Ok()) {                  return false;              }              if (NoSwap) { -                key = Parent->KeyPacker.Unpack(GetSmallValue(Iterator.GetKey()), Parent->CompCtx.HolderFactory); -                payload = Parent->CompCtx.HolderFactory.Create<TPayloadList>(Parent.Get(), Iterator.MakeCurrentKeyIter()); +                key = Parent_->KeyPacker_.Unpack(GetSmallValue(Iterator_.GetKey()), Parent_->CompCtx_.HolderFactory); +                payload = Parent_->CompCtx_.HolderFactory.Create<TPayloadList>(Parent_.Get(), Iterator_.MakeCurrentKeyIter());              } else { -                payload = Parent->KeyPacker.Unpack(GetSmallValue(Iterator.GetKey()), Parent->CompCtx.HolderFactory); -                key = Parent->CompCtx.HolderFactory.Create<TPayloadList>(Parent.Get(), Iterator.MakeCurrentKeyIter()); +                payload = Parent_->KeyPacker_.Unpack(GetSmallValue(Iterator_.GetKey()), Parent_->CompCtx_.HolderFactory); +                key = Parent_->CompCtx_.HolderFactory.Create<TPayloadList>(Parent_.Get(), Iterator_.MakeCurrentKeyIter());              } -            Iterator.NextKey(); +            Iterator_.NextKey();              return true;          }          bool Next(NUdf::TUnboxedValue& key) override { -            if (!Iterator.Ok()) { +            if (!Iterator_.Ok()) {                  return false;              }              key = NoSwap ? -                Parent->KeyPacker.Unpack(GetSmallValue(Iterator.GetKey()), Parent->CompCtx.HolderFactory): -                NUdf::TUnboxedValue(Parent->CompCtx.HolderFactory.Create<TPayloadList>(Parent.Get(), Iterator.MakeCurrentKeyIter())); -            Iterator.NextKey(); +                Parent_->KeyPacker_.Unpack(GetSmallValue(Iterator_.GetKey()), Parent_->CompCtx_.HolderFactory): +                NUdf::TUnboxedValue(Parent_->CompCtx_.HolderFactory.Create<TPayloadList>(Parent_.Get(), Iterator_.MakeCurrentKeyIter())); +            Iterator_.NextKey();              return true;          }          bool Skip() override { -            if (!Iterator.Ok()) { +            if (!Iterator_.Ok()) {                  return false;              } -            Iterator.NextKey(); +            Iterator_.NextKey();              return true;          } -        const NUdf::TRefCountedPtr<THashedCompactMultiMapHolder> Parent; -        TMapIterator Iterator; +        const NUdf::TRefCountedPtr<THashedCompactMultiMapHolder> Parent_; +        TMapIterator Iterator_;      };      THashedCompactMultiMapHolder(TMemoryUsageInfo* memInfo, TMapType&& map, TPagedArena&& pool,          TType* keyType, TType* payloadType, TComputationContext* ctx)          : TComputationValue(memInfo) -        , Pool(std::move(pool)) -        , Map(std::move(map)) -        , KeyPacker(true, keyType) -        , PayloadPacker(false, payloadType) -        , CompCtx(*ctx) +        , Pool_(std::move(pool)) +        , Map_(std::move(map)) +        , KeyPacker_(true, keyType) +        , PayloadPacker_(false, payloadType) +        , CompCtx_(*ctx)      {      }  private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override { -        auto serializedKey = KeyPacker.Pack(NUdf::TUnboxedValuePod(key)); +        auto serializedKey = KeyPacker_.Pack(NUdf::TUnboxedValuePod(key));          ui64 smallValue = AsSmallValue(serializedKey); -        return Map.Has(smallValue); +        return Map_.Has(smallValue);      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override { -        auto serializedKey = KeyPacker.Pack(NUdf::TUnboxedValuePod(key)); +        auto serializedKey = KeyPacker_.Pack(NUdf::TUnboxedValuePod(key));          ui64 smallValue = AsSmallValue(serializedKey); -        auto it = Map.Find(smallValue); +        auto it = Map_.Find(smallValue);          if (!it.Ok())              return NUdf::TUnboxedValuePod(); -        return CompCtx.HolderFactory.Create<TPayloadList>(this, it); +        return CompCtx_.HolderFactory.Create<TPayloadList>(this, it);      }      NUdf::TUnboxedValue GetKeysIterator() const override { @@ -1703,22 +1703,22 @@ private:      }      ui64 GetDictLength() const override { -        return Map.UniqSize(); +        return Map_.UniqSize();      }      bool HasDictItems() const override { -        return !Map.Empty(); +        return !Map_.Empty();      }      bool IsSortedDict() const override {          return false;      } -    TPagedArena Pool; -    const TMapType Map; -    mutable TValuePacker KeyPacker; -    mutable TValuePacker PayloadPacker; -    TComputationContext& CompCtx; +    TPagedArena Pool_; +    const TMapType Map_; +    mutable TValuePacker KeyPacker_; +    mutable TValuePacker PayloadPacker_; +    TComputationContext& CompCtx_;  };  class THashedDictHolder: public TComputationValue<THashedDictHolder> { @@ -1728,36 +1728,36 @@ public:      public:          TIterator(const THashedDictHolder* parent)              : TTemporaryComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<THashedDictHolder*>(parent)) -            , Iterator(Parent->Map.begin()) -            , End(Parent->Map.end()) -            , AtStart(true) +            , Parent_(const_cast<THashedDictHolder*>(parent)) +            , Iterator_(Parent_->Map_.begin()) +            , End_(Parent_->Map_.end()) +            , AtStart_(true)          {          }      private:          bool Skip() override { -            if (AtStart) { -                AtStart = false; +            if (AtStart_) { +                AtStart_ = false;              } else { -                if (Iterator == End) +                if (Iterator_ == End_)                      return false; -                ++Iterator; +                ++Iterator_;              } -            return Iterator != End; +            return Iterator_ != End_;          }          bool Next(NUdf::TUnboxedValue& key) override {              if (!Skip())                  return false;              if (NoSwap) { -                key = Iterator->first; -                if (Parent->Packer) { -                    key = Parent->Packer->Unpack(key.AsStringRef(), Parent->HolderFactory); +                key = Iterator_->first; +                if (Parent_->Packer_) { +                    key = Parent_->Packer_->Unpack(key.AsStringRef(), Parent_->HolderFactory_);                  }              } else { -                key = Iterator->second; +                key = Iterator_->second;              }              return true; @@ -1767,34 +1767,34 @@ public:              if (!Next(key))                  return false;              if (NoSwap) { -                payload = Iterator->second; +                payload = Iterator_->second;              } else { -                payload = Iterator->first; -                if (Parent->Packer) { -                    payload = Parent->Packer->Unpack(payload.AsStringRef(), Parent->HolderFactory); +                payload = Iterator_->first; +                if (Parent_->Packer_) { +                    payload = Parent_->Packer_->Unpack(payload.AsStringRef(), Parent_->HolderFactory_);                  }              }              return true;          } -        const NUdf::TRefCountedPtr<THashedDictHolder> Parent; -        TValuesDictHashMap::const_iterator Iterator; -        TValuesDictHashMap::const_iterator End; -        bool AtStart; +        const NUdf::TRefCountedPtr<THashedDictHolder> Parent_; +        TValuesDictHashMap::const_iterator Iterator_; +        TValuesDictHashMap::const_iterator End_; +        bool AtStart_;      };      THashedDictHolder(TMemoryUsageInfo* memInfo, THashedDictFiller filler,          const TKeyTypes& types, bool isTuple, bool eagerFill, TType* encodedType,          const NUdf::IHash* hash, const NUdf::IEquate* equate, const THolderFactory& holderFactory)          : TComputationValue(memInfo) -        , Filler(filler) -        , Types(types) -        , Map(0, TValueHasher(Types, isTuple, hash), TValueEqual(Types, isTuple, equate)) -        , IsBuilt(false) -        , HolderFactory(holderFactory) +        , Filler_(filler) +        , Types_(types) +        , Map_(0, TValueHasher(Types_, isTuple, hash), TValueEqual(Types_, isTuple, equate)) +        , IsBuilt_(false) +        , HolderFactory_(holderFactory)      {          if (encodedType) { -            Packer.emplace(true, encodedType); +            Packer_.emplace(true, encodedType);          }          if (eagerFill) @@ -1805,22 +1805,22 @@ private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Pack(key)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Pack(key));          } -        return Map.find(NUdf::TUnboxedValuePod(Packer ? encodedKey : key)) != Map.cend(); +        return Map_.find(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key)) != Map_.cend();      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override {          LazyBuildDict();          NUdf::TUnboxedValue encodedKey; -        if (Packer) { -            encodedKey = MakeString(Packer->Pack(key)); +        if (Packer_) { +            encodedKey = MakeString(Packer_->Pack(key));          } -        const auto it = Map.find(NUdf::TUnboxedValuePod(Packer ? encodedKey : key)); -        if (it == Map.cend()) +        const auto it = Map_.find(NUdf::TUnboxedValuePod(Packer_ ? encodedKey : key)); +        if (it == Map_.cend())              return NUdf::TUnboxedValuePod();          return it->second.MakeOptional();      } @@ -1842,12 +1842,12 @@ private:      ui64 GetDictLength() const override {          LazyBuildDict(); -        return Map.size(); +        return Map_.size();      }      bool HasDictItems() const override {          LazyBuildDict(); -        return !Map.empty(); +        return !Map_.empty();      }      bool IsSortedDict() const override { @@ -1856,21 +1856,21 @@ private:  private:      void LazyBuildDict() const { -        if (IsBuilt) +        if (IsBuilt_)              return; -        Filler(Map); -        Filler = THashedDictFiller(); -        IsBuilt = true; +        Filler_(Map_); +        Filler_ = THashedDictFiller(); +        IsBuilt_ = true;      }  private: -    mutable THashedDictFiller Filler; -    const TKeyTypes Types; -    mutable TValuesDictHashMap Map; -    mutable bool IsBuilt; -    const THolderFactory& HolderFactory; -    std::optional<TValuePacker> Packer; +    mutable THashedDictFiller Filler_; +    const TKeyTypes Types_; +    mutable TValuesDictHashMap Map_; +    mutable bool IsBuilt_; +    const THolderFactory& HolderFactory_; +    std::optional<TValuePacker> Packer_;  };  template <typename T, bool OptionalKey> @@ -1888,39 +1888,39 @@ public:          };          TIterator(const THashedSingleFixedMapHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<THashedSingleFixedMapHolder*>(parent)) -            , Iterator(Parent->Map.begin()) -            , End(Parent->Map.end()) -            , State(EState::AtStart) +            , Parent_(const_cast<THashedSingleFixedMapHolder*>(parent)) +            , Iterator_(Parent_->Map_.begin()) +            , End_(Parent_->Map_.end()) +            , State_(EState::AtStart)          {          }      private:          bool Skip() final { -            switch (State) { +            switch (State_) {              case EState::AtStart: -                State = OptionalKey && Parent->NullPayload.has_value() ? EState::AtNull : EState::Iterator; +                State_ = OptionalKey && Parent_->NullPayload_.has_value() ? EState::AtNull : EState::Iterator;                  break;              case EState::AtNull: -                State = EState::Iterator; +                State_ = EState::Iterator;                  break;              case EState::Iterator: -                if (Iterator == End) { +                if (Iterator_ == End_) {                      return false;                  } -                ++Iterator; +                ++Iterator_;                  break;              } -            return EState::AtNull == State || Iterator != End; +            return EState::AtNull == State_ || Iterator_ != End_;          }          bool Next(NUdf::TUnboxedValue& key) final {              if (!Skip())                  return false;              key = NoSwap -                ? (EState::AtNull == State ? NUdf::TUnboxedValue() : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator->first))) -                : (EState::AtNull == State ? *Parent->NullPayload : Iterator->second); +                ? (EState::AtNull == State_ ? NUdf::TUnboxedValue() : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator_->first))) +                : (EState::AtNull == State_ ? *Parent_->NullPayload_ : Iterator_->second);              return true;          } @@ -1928,21 +1928,21 @@ public:              if (!Next(key))                  return false;              payload = NoSwap -                ? (EState::AtNull == State ? *Parent->NullPayload : Iterator->second) -                : (EState::AtNull == State ? NUdf::TUnboxedValue() : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator->first))); +                ? (EState::AtNull == State_ ? *Parent_->NullPayload_ : Iterator_->second) +                : (EState::AtNull == State_ ? NUdf::TUnboxedValue() : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator_->first)));              return true;          } -        const NUdf::TRefCountedPtr<THashedSingleFixedMapHolder> Parent; -        typename TMapType::const_iterator Iterator; -        typename TMapType::const_iterator End; -        EState State; +        const NUdf::TRefCountedPtr<THashedSingleFixedMapHolder> Parent_; +        typename TMapType::const_iterator Iterator_; +        typename TMapType::const_iterator End_; +        EState State_;      };      THashedSingleFixedMapHolder(TMemoryUsageInfo* memInfo, TValuesDictHashSingleFixedMap<T>&& map, std::optional<NUdf::TUnboxedValue>&& nullPayload)          : TComputationValue<THashedSingleFixedMapHolder>(memInfo) -        , Map(std::move(map)) -        , NullPayload(std::move(nullPayload)) +        , Map_(std::move(map)) +        , NullPayload_(std::move(nullPayload))      {      } @@ -1950,20 +1950,20 @@ private:      bool Contains(const NUdf::TUnboxedValuePod& key) const final {          if constexpr (OptionalKey) {              if (!key) { -                return NullPayload.has_value(); +                return NullPayload_.has_value();              }          } -        return Map.find(key.Get<T>()) != Map.end(); +        return Map_.find(key.Get<T>()) != Map_.end();      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const final {          if constexpr (OptionalKey) {              if (!key) { -                return NullPayload.has_value() ? NullPayload->MakeOptional() : NUdf::TUnboxedValuePod(); +                return NullPayload_.has_value() ? NullPayload_->MakeOptional() : NUdf::TUnboxedValuePod();              }          } -        const auto it = Map.find(key.Get<T>()); -        if (it == Map.end()) +        const auto it = Map_.find(key.Get<T>()); +        if (it == Map_.end())              return NUdf::TUnboxedValuePod();          return it->second.MakeOptional();      } @@ -1981,19 +1981,19 @@ private:      }      ui64 GetDictLength() const final { -        return Map.size() + ui64(OptionalKey && NullPayload.has_value()); +        return Map_.size() + ui64(OptionalKey && NullPayload_.has_value());      }      bool HasDictItems() const final { -        return !Map.empty() || (OptionalKey && NullPayload.has_value()); +        return !Map_.empty() || (OptionalKey && NullPayload_.has_value());      }      bool IsSortedDict() const final {          return false;      } -    const TMapType Map; -    const std::optional<NUdf::TUnboxedValue> NullPayload; +    const TMapType Map_; +    const std::optional<NUdf::TUnboxedValue> NullPayload_;  };  template <typename T, bool OptionalKey> @@ -2011,28 +2011,28 @@ public:          };          TIterator(const THashedSingleFixedCompactMapHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<THashedSingleFixedCompactMapHolder*>(parent)) -            , Iterator(Parent->Map.Iterate()) -            , State(EState::AtStart) +            , Parent_(const_cast<THashedSingleFixedCompactMapHolder*>(parent)) +            , Iterator_(Parent_->Map_.Iterate()) +            , State_(EState::AtStart)          {          }      private:          bool Skip() final { -            switch (State) { +            switch (State_) {              case EState::AtStart: -                State = OptionalKey && Parent->NullPayload.has_value() ? EState::AtNull : EState::Iterator; +                State_ = OptionalKey && Parent_->NullPayload_.has_value() ? EState::AtNull : EState::Iterator;                  break;              case EState::AtNull: -                State = EState::Iterator; +                State_ = EState::Iterator;                  break;              case EState::Iterator: -                if (Iterator.Ok()) -                    ++Iterator; +                if (Iterator_.Ok()) +                    ++Iterator_;                  break;              } -            return EState::AtNull == State || Iterator.Ok(); +            return EState::AtNull == State_ || Iterator_.Ok();          }          bool Next(NUdf::TUnboxedValue& key) final { @@ -2040,13 +2040,13 @@ public:                  return false;              key = NoSwap -                ? (EState::AtNull == State +                ? (EState::AtNull == State_                      ? NUdf::TUnboxedValue() -                    : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator.Get().first)) +                    : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator_.Get().first))                    ) -                : (EState::AtNull == State -                    ? Parent->PayloadPacker.Unpack(GetSmallValue(*Parent->NullPayload), Parent->Ctx->HolderFactory) -                    : Parent->PayloadPacker.Unpack(GetSmallValue(Iterator.Get().second), Parent->Ctx->HolderFactory) +                : (EState::AtNull == State_ +                    ? Parent_->PayloadPacker_.Unpack(GetSmallValue(*Parent_->NullPayload_), Parent_->Ctx_->HolderFactory) +                    : Parent_->PayloadPacker_.Unpack(GetSmallValue(Iterator_.Get().second), Parent_->Ctx_->HolderFactory)                    );              return true;          } @@ -2055,30 +2055,30 @@ public:              if (!Next(key))                  return false;              payload =  NoSwap -                ? (EState::AtNull == State -                    ? Parent->PayloadPacker.Unpack(GetSmallValue(*Parent->NullPayload), Parent->Ctx->HolderFactory) -                    : Parent->PayloadPacker.Unpack(GetSmallValue(Iterator.Get().second), Parent->Ctx->HolderFactory) +                ? (EState::AtNull == State_ +                    ? Parent_->PayloadPacker_.Unpack(GetSmallValue(*Parent_->NullPayload_), Parent_->Ctx_->HolderFactory) +                    : Parent_->PayloadPacker_.Unpack(GetSmallValue(Iterator_.Get().second), Parent_->Ctx_->HolderFactory)                    ) -                : (EState::AtNull == State +                : (EState::AtNull == State_                      ? NUdf::TUnboxedValue() -                    : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator.Get().first)) +                    : NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(Iterator_.Get().first))                    );              return true;          } -        const NUdf::TRefCountedPtr<THashedSingleFixedCompactMapHolder> Parent; -        typename TMapType::TIterator Iterator; -        EState State; +        const NUdf::TRefCountedPtr<THashedSingleFixedCompactMapHolder> Parent_; +        typename TMapType::TIterator Iterator_; +        EState State_;      };      THashedSingleFixedCompactMapHolder(TMemoryUsageInfo* memInfo, TMapType&& map, std::optional<ui64>&& nullPayload, TPagedArena&& pool,          TType* payloadType, TComputationContext* ctx)          : TComputationValue<THashedSingleFixedCompactMapHolder>(memInfo) -        , Pool(std::move(pool)) -        , Map(std::move(map)) -        , NullPayload(std::move(nullPayload)) -        , PayloadPacker(false, payloadType) -        , Ctx(ctx) +        , Pool_(std::move(pool)) +        , Map_(std::move(map)) +        , NullPayload_(std::move(nullPayload)) +        , PayloadPacker_(false, payloadType) +        , Ctx_(ctx)      {      } @@ -2086,24 +2086,24 @@ private:      bool Contains(const NUdf::TUnboxedValuePod& key) const final {          if constexpr (OptionalKey) {              if (!key) { -                return NullPayload.has_value(); +                return NullPayload_.has_value();              }          } -        return Map.Has(key.Get<T>()); +        return Map_.Has(key.Get<T>());      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const final {          if constexpr (OptionalKey) {              if (!key) { -                return NullPayload.has_value() -                    ? PayloadPacker.Unpack(GetSmallValue(*NullPayload), Ctx->HolderFactory).Release().MakeOptional() +                return NullPayload_.has_value() +                    ? PayloadPacker_.Unpack(GetSmallValue(*NullPayload_), Ctx_->HolderFactory).Release().MakeOptional()                      : NUdf::TUnboxedValuePod();              }          } -        auto it = Map.Find(key.Get<T>()); +        auto it = Map_.Find(key.Get<T>());          if (!it.Ok())              return NUdf::TUnboxedValuePod(); -        return PayloadPacker.Unpack(GetSmallValue(it.Get().second), Ctx->HolderFactory).Release().MakeOptional(); +        return PayloadPacker_.Unpack(GetSmallValue(it.Get().second), Ctx_->HolderFactory).Release().MakeOptional();      }      NUdf::TUnboxedValue GetKeysIterator() const final { @@ -2119,11 +2119,11 @@ private:      }      ui64 GetDictLength() const final { -        return Map.Size() + ui64(OptionalKey && NullPayload.has_value()); +        return Map_.Size() + ui64(OptionalKey && NullPayload_.has_value());      }      bool HasDictItems() const final { -        return !Map.Empty() || (OptionalKey && NullPayload.has_value()); +        return !Map_.Empty() || (OptionalKey && NullPayload_.has_value());      }      bool IsSortedDict() const final { @@ -2131,11 +2131,11 @@ private:      }  private: -    TPagedArena Pool; -    const TMapType Map; -    const std::optional<ui64> NullPayload; -    mutable TValuePacker PayloadPacker; -    TComputationContext* Ctx; +    TPagedArena Pool_; +    const TMapType Map_; +    const std::optional<ui64> NullPayload_; +    mutable TValuePacker PayloadPacker_; +    TComputationContext* Ctx_;  };  template <typename T, bool OptionalKey> @@ -2150,33 +2150,33 @@ public:          public:              TIterator(const THashedSingleFixedCompactMultiMapHolder* parent, TMapIterator from)                  : TComputationValue<TIterator>(parent->GetMemInfo()) -                , Parent(const_cast<THashedSingleFixedCompactMultiMapHolder*>(parent)) -                , Iterator(from) +                , Parent_(const_cast<THashedSingleFixedCompactMultiMapHolder*>(parent)) +                , Iterator_(from)              {              }          private:              bool Next(NUdf::TUnboxedValue& value) final { -                if (!Iterator.Ok()) { +                if (!Iterator_.Ok()) {                      return false;                  } -                value = Parent->PayloadPacker.Unpack(GetSmallValue(Iterator.GetValue()), Parent->Ctx->HolderFactory); -                ++Iterator; +                value = Parent_->PayloadPacker_.Unpack(GetSmallValue(Iterator_.GetValue()), Parent_->Ctx_->HolderFactory); +                ++Iterator_;                  return true;              }              bool Skip() final { -                if (!Iterator.Ok()) { +                if (!Iterator_.Ok()) {                      return false;                  } -                ++Iterator; +                ++Iterator_;                  return true;              } -            const NUdf::TRefCountedPtr<THashedSingleFixedCompactMultiMapHolder> Parent; -            TMapIterator Iterator; +            const NUdf::TRefCountedPtr<THashedSingleFixedCompactMultiMapHolder> Parent_; +            TMapIterator Iterator_;          };          TPayloadList(TMemoryUsageInfo* memInfo, const THashedSingleFixedCompactMultiMapHolder* parent, TMapIterator from) @@ -2192,11 +2192,11 @@ public:          }          ui64 GetListLength() const final { -            if (!Length) { -                Length = Parent->Map.Count(From.GetKey()); +            if (!Length_) { +                Length_ = Parent->Map_.Count(From.GetKey());              } -            return *Length; +            return *Length_;          }          bool HasListItems() const final { @@ -2217,33 +2217,33 @@ public:          public:              TIterator(const THashedSingleFixedCompactMultiMapHolder* parent)                  : TComputationValue<TIterator>(parent->GetMemInfo()) -                , Parent(const_cast<THashedSingleFixedCompactMultiMapHolder*>(parent)) -                , Iterator(Parent->NullPayloads.cbegin()) +                , Parent_(const_cast<THashedSingleFixedCompactMultiMapHolder*>(parent)) +                , Iterator_(Parent_->NullPayloads_.cbegin())              {              }          private:              bool Next(NUdf::TUnboxedValue& value) final { -                if (Iterator == Parent->NullPayloads.cend()) { +                if (Iterator_ == Parent_->NullPayloads_.cend()) {                      return false;                  } -                value = Parent->PayloadPacker.Unpack(GetSmallValue(*Iterator), Parent->Ctx->HolderFactory); -                ++Iterator; +                value = Parent_->PayloadPacker_.Unpack(GetSmallValue(*Iterator_), Parent_->Ctx_->HolderFactory); +                ++Iterator_;                  return true;              }              bool Skip() final { -                if (Iterator == Parent->NullPayloads.cend()) { +                if (Iterator_ == Parent_->NullPayloads_.cend()) {                      return false;                  } -                ++Iterator; +                ++Iterator_;                  return true;              } -            const NUdf::TRefCountedPtr<THashedSingleFixedCompactMultiMapHolder> Parent; -            typename std::vector<ui64>::const_iterator Iterator; +            const NUdf::TRefCountedPtr<THashedSingleFixedCompactMultiMapHolder> Parent_; +            typename std::vector<ui64>::const_iterator Iterator_;          };          TNullPayloadList(TMemoryUsageInfo* memInfo, const THashedSingleFixedCompactMultiMapHolder* parent) @@ -2257,11 +2257,11 @@ public:          }          ui64 GetListLength() const final { -            if (!Length) { -                Length = Parent->NullPayloads.size(); +            if (!Length_) { +                Length_ = Parent->NullPayloads_.size();              } -            return *Length; +            return *Length_;          }          bool HasListItems() const final { @@ -2280,85 +2280,85 @@ public:      public:          TIterator(const THashedSingleFixedCompactMultiMapHolder* parent)              : TComputationValue<TIterator<NoSwap>>(parent->GetMemInfo()) -            , Parent(const_cast<THashedSingleFixedCompactMultiMapHolder*>(parent)) -            , Iterator(parent->Map.Iterate()) -            , AtNull(OptionalKey && !parent->NullPayloads.empty()) +            , Parent_(const_cast<THashedSingleFixedCompactMultiMapHolder*>(parent)) +            , Iterator_(parent->Map_.Iterate()) +            , AtNull_(OptionalKey && !parent->NullPayloads_.empty())          {          }      private:          bool Next(NUdf::TUnboxedValue& key) override { -            if (AtNull) { -                AtNull = false; +            if (AtNull_) { +                AtNull_ = false;                  key = NoSwap                      ? NUdf::TUnboxedValuePod() -                    : Parent->Ctx->HolderFactory.template Create<TNullPayloadList>(Parent.Get()); +                    : Parent_->Ctx_->HolderFactory.template Create<TNullPayloadList>(Parent_.Get());                  return true;              } -            if (!Iterator.Ok()) { +            if (!Iterator_.Ok()) {                  return false;              }              key = NoSwap ? -                NUdf::TUnboxedValuePod(Iterator.GetKey()): -                Parent->Ctx->HolderFactory.template Create<TPayloadList>(Parent.Get(), Iterator.MakeCurrentKeyIter()); -            Iterator.NextKey(); +                NUdf::TUnboxedValuePod(Iterator_.GetKey()): +                Parent_->Ctx_->HolderFactory.template Create<TPayloadList>(Parent_.Get(), Iterator_.MakeCurrentKeyIter()); +            Iterator_.NextKey();              return true;          }          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) override { -            if (AtNull) { -                AtNull = false; +            if (AtNull_) { +                AtNull_ = false;                  if (NoSwap) {                      key = NUdf::TUnboxedValuePod(); -                    payload = Parent->Ctx->HolderFactory.template Create<TNullPayloadList>(Parent.Get()); +                    payload = Parent_->Ctx_->HolderFactory.template Create<TNullPayloadList>(Parent_.Get());                  } else {                      payload = NUdf::TUnboxedValuePod(); -                    key = Parent->Ctx->HolderFactory.template Create<TNullPayloadList>(Parent.Get()); +                    key = Parent_->Ctx_->HolderFactory.template Create<TNullPayloadList>(Parent_.Get());                  }                  return true;              } -            if (!Iterator.Ok()) { +            if (!Iterator_.Ok()) {                  return false;              }              if (NoSwap) { -                key = NUdf::TUnboxedValuePod(Iterator.GetKey()); -                payload = Parent->Ctx->HolderFactory.template Create<TPayloadList>(Parent.Get(), Iterator.MakeCurrentKeyIter()); +                key = NUdf::TUnboxedValuePod(Iterator_.GetKey()); +                payload = Parent_->Ctx_->HolderFactory.template Create<TPayloadList>(Parent_.Get(), Iterator_.MakeCurrentKeyIter());              } else { -                payload = NUdf::TUnboxedValuePod(Iterator.GetKey()); -                key = Parent->Ctx->HolderFactory.template Create<TPayloadList>(Parent.Get(), Iterator.MakeCurrentKeyIter()); +                payload = NUdf::TUnboxedValuePod(Iterator_.GetKey()); +                key = Parent_->Ctx_->HolderFactory.template Create<TPayloadList>(Parent_.Get(), Iterator_.MakeCurrentKeyIter());              } -            Iterator.NextKey(); +            Iterator_.NextKey();              return true;          }          bool Skip() override { -            if (AtNull) { -                AtNull = false; +            if (AtNull_) { +                AtNull_ = false;                  return true;              } -            if (!Iterator.Ok()) { +            if (!Iterator_.Ok()) {                  return false;              } -            Iterator.NextKey(); +            Iterator_.NextKey();              return true;          } -        const NUdf::TRefCountedPtr<THashedSingleFixedCompactMultiMapHolder> Parent; -        TMapIterator Iterator; -        bool AtNull; +        const NUdf::TRefCountedPtr<THashedSingleFixedCompactMultiMapHolder> Parent_; +        TMapIterator Iterator_; +        bool AtNull_;      };      THashedSingleFixedCompactMultiMapHolder(TMemoryUsageInfo* memInfo, TMapType&& map, std::vector<ui64>&& nullPayloads, TPagedArena&& pool,          TType* payloadType, TComputationContext* ctx)          : TComputationValue<THashedSingleFixedCompactMultiMapHolder>(memInfo) -        , Pool(std::move(pool)) -        , Map(std::move(map)) -        , NullPayloads(std::move(nullPayloads)) -        , PayloadPacker(false, payloadType) -        , Ctx(ctx) +        , Pool_(std::move(pool)) +        , Map_(std::move(map)) +        , NullPayloads_(std::move(nullPayloads)) +        , PayloadPacker_(false, payloadType) +        , Ctx_(ctx)      {      } @@ -2366,24 +2366,24 @@ private:      bool Contains(const NUdf::TUnboxedValuePod& key) const override {          if constexpr (OptionalKey) {              if (!key) { -                return !NullPayloads.empty(); +                return !NullPayloads_.empty();              }          } -        return Map.Has(key.Get<T>()); +        return Map_.Has(key.Get<T>());      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override {          if constexpr (OptionalKey) {              if (!key) { -                return NullPayloads.empty() +                return NullPayloads_.empty()                      ? NUdf::TUnboxedValuePod() -                    : Ctx->HolderFactory.Create<TNullPayloadList>(this); +                    : Ctx_->HolderFactory.Create<TNullPayloadList>(this);              }          } -        const auto it = Map.Find(key.Get<T>()); +        const auto it = Map_.Find(key.Get<T>());          if (!it.Ok())              return NUdf::TUnboxedValuePod(); -        return Ctx->HolderFactory.Create<TPayloadList>(this, it); +        return Ctx_->HolderFactory.Create<TPayloadList>(this, it);      }      NUdf::TUnboxedValue GetKeysIterator() const override { @@ -2399,11 +2399,11 @@ private:      }      ui64 GetDictLength() const override { -        return Map.UniqSize() + ui64(OptionalKey && !NullPayloads.empty()); +        return Map_.UniqSize() + ui64(OptionalKey && !NullPayloads_.empty());      }      bool HasDictItems() const override { -        return !Map.Empty() || (OptionalKey && !NullPayloads.empty()); +        return !Map_.Empty() || (OptionalKey && !NullPayloads_.empty());      }      bool IsSortedDict() const override { @@ -2411,50 +2411,50 @@ private:      }  private: -    TPagedArena Pool; -    const TMapType Map; -    const std::vector<ui64> NullPayloads; -    mutable TValuePacker PayloadPacker; -    TComputationContext* Ctx; +    TPagedArena Pool_; +    const TMapType Map_; +    const std::vector<ui64> NullPayloads_; +    mutable TValuePacker PayloadPacker_; +    TComputationContext* Ctx_;  };  class TVariantHolder : public TComputationValue<TVariantHolder> {  public:      TVariantHolder(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& item, ui32 index)          : TComputationValue(memInfo) -        , Item(std::move(item)) -        , Index(index) +        , Item_(std::move(item)) +        , Index_(index)      {      }  private:      NUdf::TUnboxedValue GetVariantItem() const override { -        return Item; +        return Item_;      }      ui32 GetVariantIndex() const override { -        return Index; +        return Index_;      } -    const NUdf::TUnboxedValue Item; -    const ui32 Index; +    const NUdf::TUnboxedValue Item_; +    const ui32 Index_;  };  class TListIteratorHolder : public TComputationValue<TListIteratorHolder> {  public:      TListIteratorHolder(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& list)          : TComputationValue(memInfo) -        , List(std::move(list)) -        , Iter(List.GetListIterator()) +        , List_(std::move(list)) +        , Iter_(List_.GetListIterator())      {}  private:      NUdf::EFetchStatus Fetch(NUdf::TUnboxedValue& result) override { -        return Iter.Next(result) ? NUdf::EFetchStatus::Ok : NUdf::EFetchStatus::Finish; +        return Iter_.Next(result) ? NUdf::EFetchStatus::Ok : NUdf::EFetchStatus::Finish;      } -    const NUdf::TUnboxedValue List; -    const NUdf::TUnboxedValue Iter; +    const NUdf::TUnboxedValue List_; +    const NUdf::TUnboxedValue Iter_;  };  class TLimitedList: public TComputationValue<TLimitedList> { @@ -2463,112 +2463,112 @@ public:      public:          TIterator(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& iter, TMaybe<ui64> skip, TMaybe<ui64> take)              : TComputationValue(memInfo) -            , Iter(std::move(iter)) +            , Iter_(std::move(iter))              , Skip_(skip)              , Take_(take) -            , Index(Max<ui64>()) +            , Index_(Max<ui64>())          {          }      private:          bool Next(NUdf::TUnboxedValue& value) override { -            if (!Iter) { +            if (!Iter_) {                  return false;              }              if (Skip_) { -                while ((Index + 1) < Skip_.GetRef()) { -                    if (!Iter.Skip()) { -                        Iter = NUdf::TUnboxedValue(); +                while ((Index_ + 1) < Skip_.GetRef()) { +                    if (!Iter_.Skip()) { +                        Iter_ = NUdf::TUnboxedValue();                          return false;                      } -                    ++Index; +                    ++Index_;                  }              } -            if (Take_ && ((Index + 1) - Skip_.GetOrElse(0)) >= Take_.GetRef()) { -                Iter = NUdf::TUnboxedValue(); +            if (Take_ && ((Index_ + 1) - Skip_.GetOrElse(0)) >= Take_.GetRef()) { +                Iter_ = NUdf::TUnboxedValue();                  return false;              } -            if (!Iter.Next(value)) { -                Iter = NUdf::TUnboxedValue(); +            if (!Iter_.Next(value)) { +                Iter_ = NUdf::TUnboxedValue();                  return false;              } -            ++Index; +            ++Index_;              return true;          }          bool Skip() override { -            if (!Iter) { +            if (!Iter_) {                  return false;              }              if (Skip_) { -                while ((Index + 1) < Skip_.GetRef()) { -                    if (!Iter.Skip()) { -                        Iter = NUdf::TUnboxedValue(); +                while ((Index_ + 1) < Skip_.GetRef()) { +                    if (!Iter_.Skip()) { +                        Iter_ = NUdf::TUnboxedValue();                          return false;                      } -                    ++Index; +                    ++Index_;                  }              } -            if (Take_ && ((Index + 1) - Skip_.GetOrElse(0)) >= Take_.GetRef()) { -                Iter = NUdf::TUnboxedValue(); +            if (Take_ && ((Index_ + 1) - Skip_.GetOrElse(0)) >= Take_.GetRef()) { +                Iter_ = NUdf::TUnboxedValue();                  return false;              } -            if (!Iter.Skip()) { -                Iter = NUdf::TUnboxedValue(); +            if (!Iter_.Skip()) { +                Iter_ = NUdf::TUnboxedValue();                  return false;              } -            ++Index; +            ++Index_;              return true;          } -        NUdf::TUnboxedValue Iter; +        NUdf::TUnboxedValue Iter_;          const TMaybe<ui64> Skip_;          const TMaybe<ui64> Take_; -        ui64 Index; +        ui64 Index_;      };      TLimitedList(TMemoryUsageInfo* memInfo, NUdf::TRefCountedPtr<NUdf::IBoxedValue> parent, TMaybe<ui64> skip, TMaybe<ui64> take)          : TComputationValue(memInfo) -        , Parent(parent) -        , Skip(skip) -        , Take(take) +        , Parent_(parent) +        , Skip_(skip) +        , Take_(take)      {      }  private:      bool HasFastListLength() const override { -        return Length.Defined(); +        return Length_.Defined();      }      ui64 GetListLength() const override { -        if (!Length) { -            ui64 length = NUdf::TBoxedValueAccessor::GetListLength(*Parent); -            if (Skip) { -                if (Skip.GetRef() >= length) { +        if (!Length_) { +            ui64 length = NUdf::TBoxedValueAccessor::GetListLength(*Parent_); +            if (Skip_) { +                if (Skip_.GetRef() >= length) {                      length = 0;                  } else { -                    length -= Skip.GetRef(); +                    length -= Skip_.GetRef();                  }              } -            if (Take) { -                length = Min(length, Take.GetRef()); +            if (Take_) { +                length = Min(length, Take_.GetRef());              } -            Length = length; +            Length_ = length;          } -        return Length.GetRef(); +        return Length_.GetRef();      }      ui64 GetEstimatedListLength() const override { @@ -2576,21 +2576,21 @@ private:      }      bool HasListItems() const override { -        if (HasItems) { -            return *HasItems; +        if (HasItems_) { +            return *HasItems_;          } -        if (Length) { -            HasItems = (*Length != 0); -            return *HasItems; +        if (Length_) { +            HasItems_ = (*Length_ != 0); +            return *HasItems_;          } -        HasItems = GetListIterator().Skip(); -        return *HasItems; +        HasItems_ = GetListIterator().Skip(); +        return *HasItems_;      }      NUdf::TUnboxedValue GetListIterator() const override { -        return NUdf::TUnboxedValuePod(new TIterator(GetMemInfo(), NUdf::TBoxedValueAccessor::GetListIterator(*Parent), Skip, Take)); +        return NUdf::TUnboxedValuePod(new TIterator(GetMemInfo(), NUdf::TBoxedValueAccessor::GetListIterator(*Parent_), Skip_, Take_));      }      NUdf::IBoxedValuePtr SkipListImpl(const NUdf::IValueBuilder& builder, ui64 count) const override { @@ -2598,19 +2598,19 @@ private:              return const_cast<TLimitedList*>(this);          } -        if (Length) { -            if (count >= Length.GetRef()) { +        if (Length_) { +            if (count >= Length_.GetRef()) {                  return builder.NewEmptyList().Release().AsBoxed();              }          } -        ui64 prevSkip = Skip.GetOrElse(0); +        ui64 prevSkip = Skip_.GetOrElse(0);          if (count > Max<ui64>() - prevSkip) {              return builder.NewEmptyList().Release().AsBoxed();          }          const ui64 newSkip = prevSkip + count; -        TMaybe<ui64> newTake = Take; +        TMaybe<ui64> newTake = Take_;          if (newTake) {              if (count >= newTake.GetRef()) {                  return builder.NewEmptyList().Release().AsBoxed(); @@ -2619,7 +2619,7 @@ private:              newTake = newTake.GetRef() - count;          } -        return new TLimitedList(GetMemInfo(), Parent, newSkip, newTake); +        return new TLimitedList(GetMemInfo(), Parent_, newSkip, newTake);      }      NUdf::IBoxedValuePtr TakeListImpl(const NUdf::IValueBuilder& builder, ui64 count) const override { @@ -2627,102 +2627,102 @@ private:              return builder.NewEmptyList().Release().AsBoxed();          } -        if (Length) { -            if (count >= Length.GetRef()) { +        if (Length_) { +            if (count >= Length_.GetRef()) {                  return const_cast<TLimitedList*>(this);              }          } -        TMaybe<ui64> newTake = Take; +        TMaybe<ui64> newTake = Take_;          if (newTake) {              newTake = Min(count, newTake.GetRef());          } else {              newTake = count;          } -        return new TLimitedList(GetMemInfo(), Parent, Skip, newTake); +        return new TLimitedList(GetMemInfo(), Parent_, Skip_, newTake);      } -    NUdf::TRefCountedPtr<NUdf::IBoxedValue> Parent; -    TMaybe<ui64> Skip; -    TMaybe<ui64> Take; -    mutable TMaybe<ui64> Length; -    mutable TMaybe<bool> HasItems; +    NUdf::TRefCountedPtr<NUdf::IBoxedValue> Parent_; +    TMaybe<ui64> Skip_; +    TMaybe<ui64> Take_; +    mutable TMaybe<ui64> Length_; +    mutable TMaybe<bool> HasItems_;  };  class TLazyListDecorator : public TComputationValue<TLazyListDecorator> {  public:      TLazyListDecorator(TMemoryUsageInfo* memInfo, NUdf::IBoxedValuePtr&& list) -        : TComputationValue(memInfo), List(std::move(list)) +        : TComputationValue(memInfo), List_(std::move(list))      {}  private:      bool HasListItems() const final { -        return NUdf::TBoxedValueAccessor::HasListItems(*List); +        return NUdf::TBoxedValueAccessor::HasListItems(*List_);      }      bool HasDictItems() const final { -        return NUdf::TBoxedValueAccessor::HasDictItems(*List); +        return NUdf::TBoxedValueAccessor::HasDictItems(*List_);      }      bool HasFastListLength() const final { -        return NUdf::TBoxedValueAccessor::HasFastListLength(*List); +        return NUdf::TBoxedValueAccessor::HasFastListLength(*List_);      }      ui64 GetListLength() const final { -        return NUdf::TBoxedValueAccessor::GetListLength(*List); +        return NUdf::TBoxedValueAccessor::GetListLength(*List_);      }      ui64 GetDictLength() const final { -        return NUdf::TBoxedValueAccessor::GetDictLength(*List); +        return NUdf::TBoxedValueAccessor::GetDictLength(*List_);      }      ui64 GetEstimatedListLength() const final { -        return NUdf::TBoxedValueAccessor::GetEstimatedListLength(*List); +        return NUdf::TBoxedValueAccessor::GetEstimatedListLength(*List_);      }      NUdf::TUnboxedValue GetListIterator() const final { -        return NUdf::TBoxedValueAccessor::GetListIterator(*List); +        return NUdf::TBoxedValueAccessor::GetListIterator(*List_);      }      NUdf::TUnboxedValue GetDictIterator() const final { -        return NUdf::TBoxedValueAccessor::GetDictIterator(*List); +        return NUdf::TBoxedValueAccessor::GetDictIterator(*List_);      }      NUdf::TUnboxedValue GetPayloadsIterator() const final { -        return NUdf::TBoxedValueAccessor::GetPayloadsIterator(*List); +        return NUdf::TBoxedValueAccessor::GetPayloadsIterator(*List_);      }      NUdf::TUnboxedValue GetKeysIterator() const final { -        return NUdf::TBoxedValueAccessor::GetKeysIterator(*List); +        return NUdf::TBoxedValueAccessor::GetKeysIterator(*List_);      }      NUdf::IBoxedValuePtr ReverseListImpl(const NUdf::IValueBuilder& builder) const final { -        return NUdf::TBoxedValueAccessor::ReverseListImpl(*List, builder); +        return NUdf::TBoxedValueAccessor::ReverseListImpl(*List_, builder);      }      NUdf::IBoxedValuePtr SkipListImpl(const NUdf::IValueBuilder& builder, ui64 count) const final { -        return NUdf::TBoxedValueAccessor::SkipListImpl(*List, builder, count); +        return NUdf::TBoxedValueAccessor::SkipListImpl(*List_, builder, count);      }      NUdf::IBoxedValuePtr TakeListImpl(const NUdf::IValueBuilder& builder, ui64 count) const final { -        return NUdf::TBoxedValueAccessor::TakeListImpl(*List, builder, count); +        return NUdf::TBoxedValueAccessor::TakeListImpl(*List_, builder, count);      }      NUdf::IBoxedValuePtr ToIndexDictImpl(const NUdf::IValueBuilder& builder) const final { -        return NUdf::TBoxedValueAccessor::ToIndexDictImpl(*List, builder); +        return NUdf::TBoxedValueAccessor::ToIndexDictImpl(*List_, builder);      }      bool Contains(const NUdf::TUnboxedValuePod& key) const final { -        return NUdf::TBoxedValueAccessor::Contains(*List, key); +        return NUdf::TBoxedValueAccessor::Contains(*List_, key);      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const final { -        return NUdf::TBoxedValueAccessor::Lookup(*List, key); +        return NUdf::TBoxedValueAccessor::Lookup(*List_, key);      }      NUdf::TUnboxedValue GetElement(ui32 index) const final { -        return NUdf::TBoxedValueAccessor::GetElement(*List, index); +        return NUdf::TBoxedValueAccessor::GetElement(*List_, index);      }      const NUdf::TUnboxedValue* GetElements() const final { @@ -2730,10 +2730,10 @@ private:      }      bool IsSortedDict() const final { -        return NUdf::TBoxedValueAccessor::IsSortedDict(*List); +        return NUdf::TBoxedValueAccessor::IsSortedDict(*List_);      } -    const NUdf::IBoxedValuePtr List; +    const NUdf::IBoxedValuePtr List_;  };  } // namespace @@ -2950,36 +2950,36 @@ THolderFactory::THolderFactory(      TAllocState& allocState,      TMemoryUsageInfo& memInfo,      const IFunctionRegistry* functionRegistry) -    : CurrentAllocState(&allocState) -    , MemInfo(memInfo) -    , FunctionRegistry(functionRegistry) +    : CurrentAllocState_(&allocState) +    , MemInfo_(memInfo) +    , FunctionRegistry_(functionRegistry)  {  }  THolderFactory::~THolderFactory() { -    if (EmptyContainer) { -        CurrentAllocState->UnlockObject(*EmptyContainer); +    if (EmptyContainer_) { +        CurrentAllocState_->UnlockObject(*EmptyContainer_);      }  }  NUdf::TUnboxedValuePod THolderFactory::GetEmptyContainerLazy() const { -    if (!EmptyContainer) { -        EmptyContainer.ConstructInPlace( -            NUdf::TUnboxedValuePod(AllocateOn<TEmptyContainerHolder>(CurrentAllocState, &MemInfo))); -        CurrentAllocState->LockObject(*EmptyContainer); +    if (!EmptyContainer_) { +        EmptyContainer_.ConstructInPlace( +            NUdf::TUnboxedValuePod(AllocateOn<TEmptyContainerHolder>(CurrentAllocState_, &MemInfo_))); +        CurrentAllocState_->LockObject(*EmptyContainer_);      } -    return *EmptyContainer; +    return *EmptyContainer_;  }  NUdf::TUnboxedValuePod THolderFactory::CreateTypeHolder(TType* type) const { -    return NUdf::TUnboxedValuePod(AllocateOn<TTypeHolder>(CurrentAllocState, &MemInfo, type)); +    return NUdf::TUnboxedValuePod(AllocateOn<TTypeHolder>(CurrentAllocState_, &MemInfo_, type));  }  NUdf::TUnboxedValuePod THolderFactory::CreateDirectListHolder(TDefaultListRepresentation&& items) const{      if (!items.GetLength())          return GetEmptyContainerLazy(); -    return NUdf::TUnboxedValuePod(AllocateOn<TDirectListHolder>(CurrentAllocState, &MemInfo, std::move(items))); +    return NUdf::TUnboxedValuePod(AllocateOn<TDirectListHolder>(CurrentAllocState_, &MemInfo_, std::move(items)));  }  NUdf::TUnboxedValuePod THolderFactory::CreateDirectArrayHolder(ui64 size, NUdf::TUnboxedValue*& itemsPtr) const { @@ -2989,8 +2989,8 @@ NUdf::TUnboxedValuePod THolderFactory::CreateDirectArrayHolder(ui64 size, NUdf::      }      const auto buffer = MKQLAllocFastWithSize( -        sizeof(TDirectArrayHolderInplace) + size * sizeof(NUdf::TUnboxedValue), CurrentAllocState, EMemorySubPool::Default); -    const auto h = ::new(buffer) TDirectArrayHolderInplace(&MemInfo, size); +        sizeof(TDirectArrayHolderInplace) + size * sizeof(NUdf::TUnboxedValue), CurrentAllocState_, EMemorySubPool::Default); +    const auto h = ::new(buffer) TDirectArrayHolderInplace(&MemInfo_, size);      auto res = NUdf::TUnboxedValuePod(h);      itemsPtr = h->GetPtr(); @@ -3015,27 +3015,27 @@ NUdf::TUnboxedValuePod THolderFactory::VectorAsArray(TUnboxedValueVector& values  }  NUdf::TUnboxedValuePod THolderFactory::NewVectorHolder() const { -    return NUdf::TUnboxedValuePod(new TVectorHolder(&MemInfo)); +    return NUdf::TUnboxedValuePod(new TVectorHolder(&MemInfo_));  }  NUdf::TUnboxedValuePod THolderFactory::NewTemporaryVectorHolder() const { -    return NUdf::TUnboxedValuePod(new TTemporaryVectorHolder(&MemInfo)); +    return NUdf::TUnboxedValuePod(new TTemporaryVectorHolder(&MemInfo_));  }  const NUdf::IHash* THolderFactory::GetHash(TType& type, bool useIHash) const { -    return useIHash ? HashRegistry.FindOrEmplace(type) : nullptr; +    return useIHash ? HashRegistry_.FindOrEmplace(type) : nullptr;  }  const NUdf::IEquate* THolderFactory::GetEquate(TType& type, bool useIHash) const { -    return useIHash ? EquateRegistry.FindOrEmplace(type) : nullptr; +    return useIHash ? EquateRegistry_.FindOrEmplace(type) : nullptr;  }  const NUdf::ICompare* THolderFactory::GetCompare(TType& type, bool useIHash) const { -    return useIHash ? CompareRegistry.FindOrEmplace(type) : nullptr; +    return useIHash ? CompareRegistry_.FindOrEmplace(type) : nullptr;  }  NUdf::TUnboxedValuePod THolderFactory::VectorAsVectorHolder(TUnboxedValueVector&& list) const { -    return NUdf::TUnboxedValuePod(new TVectorHolder(&MemInfo, std::move(list))); +    return NUdf::TUnboxedValuePod(new TVectorHolder(&MemInfo_, std::move(list)));  }  NUdf::TUnboxedValuePod THolderFactory::CloneArray(const NUdf::TUnboxedValuePod list, NUdf::TUnboxedValue*& items) const { @@ -3110,7 +3110,7 @@ NUdf::TUnboxedValuePod THolderFactory::CreateLimitedList(          return NUdf::TUnboxedValuePod(std::move(parent));      } -    return NUdf::TUnboxedValuePod(AllocateOn<TLimitedList>(CurrentAllocState, &MemInfo, std::move(parent), skip, take)); +    return NUdf::TUnboxedValuePod(AllocateOn<TLimitedList>(CurrentAllocState_, &MemInfo_, std::move(parent), skip, take));  }  NUdf::TUnboxedValuePod THolderFactory::ReverseList(const NUdf::IValueBuilder* builder, const NUdf::TUnboxedValuePod list) const @@ -3194,7 +3194,7 @@ template NUdf::TUnboxedValuePod THolderFactory::Collect<true>(NUdf::TUnboxedValu  template NUdf::TUnboxedValuePod THolderFactory::Collect<false>(NUdf::TUnboxedValuePod list) const;  NUdf::TUnboxedValuePod THolderFactory::LazyList(NUdf::TUnboxedValuePod list) const { -    return NUdf::TUnboxedValuePod(AllocateOn<TLazyListDecorator>(CurrentAllocState, &MemInfo, list.AsBoxed()));; +    return NUdf::TUnboxedValuePod(AllocateOn<TLazyListDecorator>(CurrentAllocState_, &MemInfo_, list.AsBoxed()));;  }  NUdf::TUnboxedValuePod THolderFactory::Append(NUdf::TUnboxedValuePod list, NUdf::TUnboxedValuePod last) const { @@ -3325,15 +3325,15 @@ NUdf::TUnboxedValuePod THolderFactory::CreateVariantHolder(NUdf::TUnboxedValuePo  }  NUdf::TUnboxedValuePod THolderFactory::CreateBoxedVariantHolder(NUdf::TUnboxedValuePod item, ui32 index) const { -    return NUdf::TUnboxedValuePod(AllocateOn<TVariantHolder>(CurrentAllocState, &MemInfo, std::move(item), index)); +    return NUdf::TUnboxedValuePod(AllocateOn<TVariantHolder>(CurrentAllocState_, &MemInfo_, std::move(item), index));  }  NUdf::TUnboxedValuePod THolderFactory::CreateIteratorOverList(NUdf::TUnboxedValuePod list) const { -    return NUdf::TUnboxedValuePod(AllocateOn<TListIteratorHolder>(CurrentAllocState, &MemInfo, list)); +    return NUdf::TUnboxedValuePod(AllocateOn<TListIteratorHolder>(CurrentAllocState_, &MemInfo_, list));  }  NUdf::TUnboxedValuePod THolderFactory::CreateForwardList(NUdf::TUnboxedValuePod stream) const { -    return NUdf::TUnboxedValuePod(AllocateOn<TForwardListValue>(CurrentAllocState, &MemInfo, stream)); +    return NUdf::TUnboxedValuePod(AllocateOn<TForwardListValue>(CurrentAllocState_, &MemInfo_, stream));  }  NUdf::TUnboxedValuePod THolderFactory::CreateDirectSortedSetHolder( @@ -3346,7 +3346,7 @@ NUdf::TUnboxedValuePod THolderFactory::CreateDirectSortedSetHolder(          const NUdf::ICompare* compare,          const NUdf::IEquate* equate) const  { -    return NUdf::TUnboxedValuePod(AllocateOn<TSortedSetHolder>(CurrentAllocState, &MemInfo, +    return NUdf::TUnboxedValuePod(AllocateOn<TSortedSetHolder>(CurrentAllocState_, &MemInfo_,          filler, types, isTuple, mode, eagerFill, encodedType, compare, equate, *this));  } @@ -3360,7 +3360,7 @@ NUdf::TUnboxedValuePod THolderFactory::CreateDirectSortedDictHolder(          const NUdf::ICompare* compare,          const NUdf::IEquate* equate) const  { -    return NUdf::TUnboxedValuePod(AllocateOn<TSortedDictHolder>(CurrentAllocState, &MemInfo, +    return NUdf::TUnboxedValuePod(AllocateOn<TSortedDictHolder>(CurrentAllocState_, &MemInfo_,          filler, types, isTuple, mode, eagerFill, encodedType, compare, equate, *this));  } @@ -3373,7 +3373,7 @@ NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedDictHolder(          const NUdf::IHash* hash,          const NUdf::IEquate* equate) const  { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedDictHolder>(CurrentAllocState, &MemInfo, +    return NUdf::TUnboxedValuePod(AllocateOn<THashedDictHolder>(CurrentAllocState_, &MemInfo_,          filler, types, isTuple, eagerFill, encodedType, hash, equate, *this));  } @@ -3385,14 +3385,14 @@ NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedSetHolder(      TType* encodedType,      const NUdf::IHash* hash,      const NUdf::IEquate* equate) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedSetHolder>(CurrentAllocState, &MemInfo, +    return NUdf::TUnboxedValuePod(AllocateOn<THashedSetHolder>(CurrentAllocState_, &MemInfo_,          filler, types, isTuple, eagerFill, encodedType, hash, equate, *this));  }  template <typename T, bool OptionalKey>  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedSingleFixedSetHolder(      TValuesDictHashSingleFixedSet<T>&& set, bool hasNull) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedSetHolder<T, OptionalKey>>(CurrentAllocState, &MemInfo, std::move(set), hasNull)); +    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedSetHolder<T, OptionalKey>>(CurrentAllocState_, &MemInfo_, std::move(set), hasNull));  }  #define DEFINE_HASHED_SINGLE_FIXED_SET_OPT(xType) \ @@ -3412,7 +3412,7 @@ KNOWN_PRIMITIVE_VALUE_TYPES(DEFINE_HASHED_SINGLE_FIXED_SET_NONOPT)  template <typename T, bool OptionalKey>  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedSingleFixedCompactSetHolder(      TValuesDictHashSingleFixedCompactSet<T>&& set, bool hasNull) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedCompactSetHolder<T, OptionalKey>>(CurrentAllocState, &MemInfo, std::move(set), hasNull)); +    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedCompactSetHolder<T, OptionalKey>>(CurrentAllocState_, &MemInfo_, std::move(set), hasNull));  }  #define DEFINE_HASHED_SINGLE_FIXED_COMPACT_SET_OPT(xType) \ @@ -3432,31 +3432,31 @@ KNOWN_PRIMITIVE_VALUE_TYPES(DEFINE_HASHED_SINGLE_FIXED_COMPACT_SET_NONOPT)  template <typename T, bool OptionalKey>  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedSingleFixedMapHolder(      TValuesDictHashSingleFixedMap<T>&& map, std::optional<NUdf::TUnboxedValue>&& nullPayload) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedMapHolder<T, OptionalKey>>(CurrentAllocState, &MemInfo, std::move(map), std::move(nullPayload))); +    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedMapHolder<T, OptionalKey>>(CurrentAllocState_, &MemInfo_, std::move(map), std::move(nullPayload)));  }  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedCompactSetHolder(      TValuesDictHashCompactSet&& set, TPagedArena&& pool, TType* keyType, TComputationContext* ctx) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedCompactSetHolder>(CurrentAllocState, &MemInfo, std::move(set), std::move(pool), keyType, ctx)); +    return NUdf::TUnboxedValuePod(AllocateOn<THashedCompactSetHolder>(CurrentAllocState_, &MemInfo_, std::move(set), std::move(pool), keyType, ctx));  }  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedCompactMapHolder(      TValuesDictHashCompactMap&& map, TPagedArena&& pool, TType* keyType, TType* payloadType,      TComputationContext* ctx) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedCompactMapHolder>(CurrentAllocState, &MemInfo, std::move(map), std::move(pool), keyType, payloadType, ctx)); +    return NUdf::TUnboxedValuePod(AllocateOn<THashedCompactMapHolder>(CurrentAllocState_, &MemInfo_, std::move(map), std::move(pool), keyType, payloadType, ctx));  }  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedCompactMultiMapHolder(      TValuesDictHashCompactMultiMap&& map, TPagedArena&& pool, TType* keyType, TType* payloadType,      TComputationContext* ctx) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedCompactMultiMapHolder>(CurrentAllocState, &MemInfo, std::move(map), std::move(pool), keyType, payloadType, ctx)); +    return NUdf::TUnboxedValuePod(AllocateOn<THashedCompactMultiMapHolder>(CurrentAllocState_, &MemInfo_, std::move(map), std::move(pool), keyType, payloadType, ctx));  }  template <typename T, bool OptionalKey>  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedSingleFixedCompactMapHolder(      TValuesDictHashSingleFixedCompactMap<T>&& map, std::optional<ui64>&& nullPayload, TPagedArena&& pool, TType* payloadType,      TComputationContext* ctx) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedCompactMapHolder<T, OptionalKey>>(CurrentAllocState, &MemInfo, +    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedCompactMapHolder<T, OptionalKey>>(CurrentAllocState_, &MemInfo_,          std::move(map), std::move(nullPayload), std::move(pool), payloadType, ctx));  } @@ -3464,7 +3464,7 @@ template <typename T, bool OptionalKey>  NUdf::TUnboxedValuePod THolderFactory::CreateDirectHashedSingleFixedCompactMultiMapHolder(      TValuesDictHashSingleFixedCompactMultiMap<T>&& map, std::vector<ui64>&& nullPayloads, TPagedArena&& pool, TType* payloadType,      TComputationContext* ctx) const { -    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedCompactMultiMapHolder<T, OptionalKey>>(CurrentAllocState, &MemInfo, +    return NUdf::TUnboxedValuePod(AllocateOn<THashedSingleFixedCompactMultiMapHolder<T, OptionalKey>>(CurrentAllocState_, &MemInfo_,          std::move(map), std::move(nullPayloads), std::move(pool), payloadType, ctx));  } @@ -3583,23 +3583,23 @@ TPlainContainerCache::TPlainContainerCache() {  }  void TPlainContainerCache::Clear() { -    Cached.fill(NUdf::TUnboxedValue()); -    CachedItems.fill(nullptr); +    Cached_.fill(NUdf::TUnboxedValue()); +    CachedItems_.fill(nullptr);  }  NUdf::TUnboxedValuePod TPlainContainerCache::NewArray(const THolderFactory& factory, ui64 size, NUdf::TUnboxedValue*& items) { -    if (!CachedItems[CacheIndex] || !Cached[CacheIndex].UniqueBoxed()) { -        CacheIndex ^= 1U; -        if (!CachedItems[CacheIndex] || !Cached[CacheIndex].UniqueBoxed()) { -            Cached[CacheIndex] = factory.CreateDirectArrayHolder(size, CachedItems[CacheIndex]); -            items = CachedItems[CacheIndex]; -            return static_cast<const NUdf::TUnboxedValuePod&>(Cached[CacheIndex]); +    if (!CachedItems_[CacheIndex_] || !Cached_[CacheIndex_].UniqueBoxed()) { +        CacheIndex_ ^= 1U; +        if (!CachedItems_[CacheIndex_] || !Cached_[CacheIndex_].UniqueBoxed()) { +            Cached_[CacheIndex_] = factory.CreateDirectArrayHolder(size, CachedItems_[CacheIndex_]); +            items = CachedItems_[CacheIndex_]; +            return static_cast<const NUdf::TUnboxedValuePod&>(Cached_[CacheIndex_]);          }      } -    items = CachedItems[CacheIndex]; +    items = CachedItems_[CacheIndex_];      std::fill_n(items, size, NUdf::TUnboxedValue()); -    return static_cast<const NUdf::TUnboxedValuePod&>(Cached[CacheIndex]); +    return static_cast<const NUdf::TUnboxedValuePod&>(Cached_[CacheIndex_]);  }  } // namespace NMiniKQL diff --git a/yql/essentials/minikql/computation/mkql_computation_node_holders.h b/yql/essentials/minikql/computation/mkql_computation_node_holders.h index 1eb4468a98b..9ed032632b4 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_holders.h +++ b/yql/essentials/minikql/computation/mkql_computation_node_holders.h @@ -565,7 +565,7 @@ class TTypeHolder: public TComputationValue<TTypeHolder> {  public:      TTypeHolder(TMemoryUsageInfo* memInfo, TType* type)          : TComputationValue(memInfo) -        , Type(type) +        , Type_(type)      {}      NUdf::TStringRef GetResourceTag() const override { @@ -573,11 +573,11 @@ public:      }      void* GetResource() override { -        return Type; +        return Type_;      }  private: -    TType* const Type; +    TType* const Type_;  };  class TArrowBlock: public TComputationValue<TArrowBlock> { @@ -615,9 +615,9 @@ class TTypeOperationsRegistry {      using TValuePtr = typename IFace::TPtr;  public:      IFace* FindOrEmplace(TType& type) const { -        const TString serializedType = SerializeNode(&type, NodeStack); -        auto it = Registry.find(serializedType); -        if (it == Registry.end()) { +        const TString serializedType = SerializeNode(&type, NodeStack_); +        auto it = Registry_.find(serializedType); +        if (it == Registry_.end()) {              TValuePtr ptr;              if constexpr (std::is_same_v<IFace, NUdf::IHash>) {                  ptr = MakeHashImpl(&type); @@ -629,14 +629,14 @@ public:                  static_assert(TDependentFalse<IFace>, "unexpected type");              }              auto p = std::make_pair(std::move(serializedType), std::move(ptr)); -            it = Registry.insert(std::move(p)).first; +            it = Registry_.insert(std::move(p)).first;          }          return it->second.Get();      }  private: -    mutable std::vector<TNode*> NodeStack; -    mutable THashMap<TString, TValuePtr> Registry; +    mutable std::vector<TNode*> NodeStack_; +    mutable THashMap<TString, TValuePtr> Registry_;  };  class TDirectArrayHolderInplace : public TComputationValue<TDirectArrayHolderInplace> { @@ -652,22 +652,22 @@ public:      TDirectArrayHolderInplace(TMemoryUsageInfo* memInfo, ui64 size)          : TComputationValue(memInfo) -        , Size(size) +        , Size_(size)      { -        MKQL_ENSURE(Size > 0U, "Can't create empty array holder."); -        MKQL_MEM_TAKE(GetMemInfo(), GetPtr(), Size * sizeof(NUdf::TUnboxedValue)); -        std::memset(GetPtr(), 0, Size * sizeof(NUdf::TUnboxedValue)); +        MKQL_ENSURE(Size_ > 0U, "Can't create empty array holder."); +        MKQL_MEM_TAKE(GetMemInfo(), GetPtr(), Size_ * sizeof(NUdf::TUnboxedValue)); +        std::memset(GetPtr(), 0, Size_ * sizeof(NUdf::TUnboxedValue));      }      ~TDirectArrayHolderInplace() { -        for (ui64 i = 0U; i < Size; ++i) { +        for (ui64 i = 0U; i < Size_; ++i) {              (GetPtr() + i)->~TUnboxedValue();          } -        MKQL_MEM_RETURN(GetMemInfo(), GetPtr(), Size * sizeof(NUdf::TUnboxedValue)); +        MKQL_MEM_RETURN(GetMemInfo(), GetPtr(), Size_ * sizeof(NUdf::TUnboxedValue));      }      ui64 GetSize() const { -        return Size; +        return Size_;      }      NUdf::TUnboxedValue* GetPtr() const { @@ -678,51 +678,51 @@ private:      class TIterator : public TTemporaryComputationValue<TIterator> {      public:          TIterator(const TDirectArrayHolderInplace* parent) -            : TTemporaryComputationValue(parent->GetMemInfo()), Parent(const_cast<TDirectArrayHolderInplace*>(parent)) +            : TTemporaryComputationValue(parent->GetMemInfo()), Parent_(const_cast<TDirectArrayHolderInplace*>(parent))          {}      private:          bool Skip() final { -            return ++Current < Parent->GetSize(); +            return ++Current_ < Parent_->GetSize();          }          bool Next(NUdf::TUnboxedValue& value) final {              if (!Skip())                  return false; -            value = Parent->GetPtr()[Current]; +            value = Parent_->GetPtr()[Current_];              return true;          }          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) final {              if (!Next(payload))                  return false; -            key = NUdf::TUnboxedValuePod(Current); +            key = NUdf::TUnboxedValuePod(Current_);              return true;          } -        const NUdf::TRefCountedPtr<TDirectArrayHolderInplace> Parent; -        ui64 Current = Max<ui64>(); +        const NUdf::TRefCountedPtr<TDirectArrayHolderInplace> Parent_; +        ui64 Current_ = Max<ui64>();      };      class TKeysIterator : public TTemporaryComputationValue<TKeysIterator> {      public:          TKeysIterator(const TDirectArrayHolderInplace& parent) -            : TTemporaryComputationValue(parent.GetMemInfo()), Size(parent.GetSize()) +            : TTemporaryComputationValue(parent.GetMemInfo()), Size_(parent.GetSize())          {}      private:          bool Skip() final { -            return ++Current < Size; +            return ++Current_ < Size_;          }          bool Next(NUdf::TUnboxedValue& key) final {              if (!Skip())                  return false; -            key = NUdf::TUnboxedValuePod(Current); +            key = NUdf::TUnboxedValuePod(Current_);              return true;          } -        const ui64 Size; -        ui64 Current = Max<ui64>(); +        const ui64 Size_; +        ui64 Current_ = Max<ui64>();      };      bool HasListItems() const final { @@ -738,15 +738,15 @@ private:      }      ui64 GetListLength() const final { -        return Size; +        return Size_;      }      ui64 GetDictLength() const final { -        return Size; +        return Size_;      }      ui64 GetEstimatedListLength() const final { -        return Size; +        return Size_;      }      NUdf::TUnboxedValue GetListIterator() const final { @@ -766,12 +766,12 @@ private:      }      NUdf::IBoxedValuePtr ReverseListImpl(const NUdf::IValueBuilder& builder) const final { -        if (1U >= Size) +        if (1U >= Size_)              return const_cast<TDirectArrayHolderInplace*>(this);          NUdf::TUnboxedValue* items = nullptr; -        auto result = builder.NewArray(Size, items); -        std::reverse_copy(GetPtr(), GetPtr() + Size, items); +        auto result = builder.NewArray(Size_, items); +        std::reverse_copy(GetPtr(), GetPtr() + Size_, items);          return result.Release().AsBoxed();      } @@ -779,10 +779,10 @@ private:          if (!count)              return const_cast<TDirectArrayHolderInplace*>(this); -        if (count >= Size) +        if (count >= Size_)              return builder.NewEmptyList().Release().AsBoxed(); -        const auto newSize = Size - count; +        const auto newSize = Size_ - count;          NUdf::TUnboxedValue* items = nullptr;          auto result = builder.NewArray(newSize, items);          std::copy_n(GetPtr() + count, newSize, items); @@ -793,7 +793,7 @@ private:          if (!count)              return builder.NewEmptyList().Release().AsBoxed(); -        if (count >= Size) +        if (count >= Size_)              return const_cast<TDirectArrayHolderInplace*>(this);          const auto newSize = count; @@ -808,16 +808,16 @@ private:      }      bool Contains(const NUdf::TUnboxedValuePod& key) const final { -        return key.Get<ui64>() < Size; +        return key.Get<ui64>() < Size_;      }      NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const final {          const auto index = key.Get<ui64>(); -        return index < Size ? GetPtr()[index].MakeOptional() : NUdf::TUnboxedValuePod(); +        return index < Size_ ? GetPtr()[index].MakeOptional() : NUdf::TUnboxedValuePod();      }      NUdf::TUnboxedValue GetElement(ui32 index) const final { -        Y_DEBUG_ABORT_UNLESS(index < Size); +        Y_DEBUG_ABORT_UNLESS(index < Size_);          return GetPtr()[index];      } @@ -829,7 +829,7 @@ private:          return true;      } -    const ui64 Size; +    const ui64 Size_;  };  ////////////////////////////////////////////////////////////////////////////// @@ -847,7 +847,7 @@ public:      template <typename T, typename... TArgs>      NUdf::TUnboxedValuePod Create(TArgs&&... args) const { -        return NUdf::TUnboxedValuePod(AllocateOn<T>(CurrentAllocState, &MemInfo, std::forward<TArgs>(args)...)); +        return NUdf::TUnboxedValuePod(AllocateOn<T>(CurrentAllocState_, &MemInfo_, std::forward<TArgs>(args)...));      }      NUdf::TUnboxedValuePod CreateTypeHolder(TType* type) const; @@ -988,27 +988,27 @@ public:      NUdf::TUnboxedValuePod CloneArray(const NUdf::TUnboxedValuePod list, NUdf::TUnboxedValue*& itemsPtr) const;      TMemoryUsageInfo& GetMemInfo() const { -        return MemInfo; +        return MemInfo_;      }      NUdf::TUnboxedValuePod GetEmptyContainerLazy() const;      void CleanupModulesOnTerminate() const { -        if (FunctionRegistry) { -            FunctionRegistry->CleanupModulesOnTerminate(); +        if (FunctionRegistry_) { +            FunctionRegistry_->CleanupModulesOnTerminate();          }      }      TAlignedPagePool& GetPagePool() const { -        return *CurrentAllocState; +        return *CurrentAllocState_;      }      ui64 GetMemoryUsed() const { -        return CurrentAllocState->GetUsed(); +        return CurrentAllocState_->GetUsed();      }      const IFunctionRegistry* GetFunctionRegistry() const { -        return FunctionRegistry; +        return FunctionRegistry_;      }      template<bool FromStreams> @@ -1016,14 +1016,14 @@ public:      NUdf::TUnboxedValuePod ExtendStream(NUdf::TUnboxedValue* data, ui64 size) const;  private: -    TAllocState* const CurrentAllocState; -    TMemoryUsageInfo& MemInfo; -    const IFunctionRegistry* const FunctionRegistry; -    mutable TMaybe<NUdf::TUnboxedValue> EmptyContainer; - -    mutable TTypeOperationsRegistry<NUdf::IHash> HashRegistry; -    mutable TTypeOperationsRegistry<NUdf::IEquate> EquateRegistry; -    mutable TTypeOperationsRegistry<NUdf::ICompare> CompareRegistry; +    TAllocState* const CurrentAllocState_; +    TMemoryUsageInfo& MemInfo_; +    const IFunctionRegistry* const FunctionRegistry_; +    mutable TMaybe<NUdf::TUnboxedValue> EmptyContainer_; + +    mutable TTypeOperationsRegistry<NUdf::IHash> HashRegistry_; +    mutable TTypeOperationsRegistry<NUdf::IEquate> EquateRegistry_; +    mutable TTypeOperationsRegistry<NUdf::ICompare> CompareRegistry_;  };  constexpr const ui32 STEP_FOR_RSS_CHECK = 100U; @@ -1052,40 +1052,40 @@ public:      TKeyTypeContanerHelper(const TType* type) {          bool encoded;          bool useIHash; -        GetDictionaryKeyTypes(type, KeyTypes, IsTuple, encoded, useIHash); +        GetDictionaryKeyTypes(type, KeyTypes_, IsTuple_, encoded, useIHash);          if (useIHash || encoded) {              if constexpr(SupportEqual) { -                Equate = MakeEquateImpl(type); +                Equate_ = MakeEquateImpl(type);              }              if constexpr(SupportHash) { -                Hash = MakeHashImpl(type); +                Hash_ = MakeHashImpl(type);              }              if constexpr(SupportLess) { -                Compare = MakeCompareImpl(type); +                Compare_ = MakeCompareImpl(type);              }          }      }  public: //unavailable getters may be eliminated at compile time, but it'd make code much less readable      TValueEqual GetValueEqual() const{          Y_ABORT_UNLESS(SupportEqual); -        return TValueEqual(KeyTypes, IsTuple, Equate.Get()); +        return TValueEqual(KeyTypes_, IsTuple_, Equate_.Get());      }      TValueHasher GetValueHash() const{          Y_ABORT_UNLESS(SupportHash); -        return TValueHasher(KeyTypes, IsTuple, Hash.Get()); +        return TValueHasher(KeyTypes_, IsTuple_, Hash_.Get());      }      TValueLess GetValueLess() const{          Y_ABORT_UNLESS(SupportLess); -        return TValueLess(KeyTypes, IsTuple , Compare.Get()); +        return TValueLess(KeyTypes_, IsTuple_ , Compare_.Get());      }  private: -    TKeyTypes KeyTypes; -    bool IsTuple = false; +    TKeyTypes KeyTypes_; +    bool IsTuple_ = false;      //unsused pointers may be eliminated at compile time, but it'd make code much less readable -    NUdf::IEquate::TPtr Equate; -    NUdf::IHash::TPtr Hash; -    NUdf::ICompare::TPtr Compare; +    NUdf::IEquate::TPtr Equate_; +    NUdf::IHash::TPtr Hash_; +    NUdf::ICompare::TPtr Compare_;  };  class TPlainContainerCache { @@ -1100,21 +1100,21 @@ public:      NUdf::TUnboxedValuePod NewArray(const THolderFactory& factory, ui64 size, NUdf::TUnboxedValue*& items);  private: -    std::array<NUdf::TUnboxedValue, 2> Cached; -    std::array<NUdf::TUnboxedValue*, 2> CachedItems; -    ui8 CacheIndex = 0U; +    std::array<NUdf::TUnboxedValue, 2> Cached_; +    std::array<NUdf::TUnboxedValue*, 2> CachedItems_; +    ui8 CacheIndex_ = 0U;  };  template<class TObject>  class TMutableObjectOverBoxedValue {  public:      TMutableObjectOverBoxedValue(TComputationMutables& mutables) -        : ObjectIndex(mutables.CurValueIndex++) +        : ObjectIndex_(mutables.CurValueIndex++)      {}      template <typename... Args>      TObject& RefMutableObject(TComputationContext& ctx, Args&&... args) const { -        auto& unboxed = ctx.MutableValues[ObjectIndex]; +        auto& unboxed = ctx.MutableValues[ObjectIndex_];          if (!unboxed.HasValue()) {              unboxed = ctx.HolderFactory.Create<TObject>(std::forward<Args>(args)...);          } @@ -1122,7 +1122,7 @@ public:          return *static_cast<TObject*>(boxed.Get());      }  private: -    const ui32 ObjectIndex; +    const ui32 ObjectIndex_;  };  } // namespace NMiniKQL diff --git a/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.cpp b/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.cpp index 72f21b0c0aa..5757c21ece5 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.cpp @@ -243,7 +243,7 @@ public:          const auto type = ArrayType::get(valType, ValueNodes.size());          const auto ptrType = PointerType::getUnqual(type);          /// TODO: how to get computation context or other workaround -        const auto itms = *Stateless || ctx.AlwaysInline ? +        const auto itms = *Stateless_ || ctx.AlwaysInline ?              new AllocaInst(ptrType, 0U, "itms", &ctx.Func->getEntryBlock().back()):              new AllocaInst(ptrType, 0U, "itms", block);          const auto result = Cache.GenNewArray(ValueNodes.size(), itms, ctx, block); diff --git a/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp b/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp index 49f686dd9e0..8069acdb7ca 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp @@ -31,26 +31,26 @@ template class TRefCountedComputationNode<IComputationWideFlowNode>;  template class TRefCountedComputationNode<IComputationWideFlowProxyNode>;  TUnboxedImmutableComputationNode::TUnboxedImmutableComputationNode(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& value) -    : MemInfo(memInfo) -    , UnboxedValue(std::move(value)) -    , RepresentationKind(UnboxedValue.HasValue() ? (UnboxedValue.IsBoxed() ? EValueRepresentation::Boxed : (UnboxedValue.IsString() ? EValueRepresentation::String : EValueRepresentation::Embedded)) : EValueRepresentation::Embedded) +    : MemInfo_(memInfo) +    , UnboxedValue_(std::move(value)) +    , RepresentationKind_(UnboxedValue_.HasValue() ? (UnboxedValue_.IsBoxed() ? EValueRepresentation::Boxed : (UnboxedValue_.IsString() ? EValueRepresentation::String : EValueRepresentation::Embedded)) : EValueRepresentation::Embedded)  { -    MKQL_MEM_TAKE(MemInfo, this, sizeof(*this), __MKQL_LOCATION__); -    TlsAllocState->LockObject(UnboxedValue); +    MKQL_MEM_TAKE(MemInfo_, this, sizeof(*this), __MKQL_LOCATION__); +    TlsAllocState->LockObject(UnboxedValue_);  }  TUnboxedImmutableComputationNode::~TUnboxedImmutableComputationNode() { -    MKQL_MEM_RETURN(MemInfo, this, sizeof(*this)); -    TlsAllocState->UnlockObject(UnboxedValue); +    MKQL_MEM_RETURN(MemInfo_, this, sizeof(*this)); +    TlsAllocState->UnlockObject(UnboxedValue_);  }  NUdf::TUnboxedValue TUnboxedImmutableComputationNode::GetValue(TComputationContext& compCtx) const {      Y_UNUSED(compCtx); -    if (!TlsAllocState->UseRefLocking && RepresentationKind == EValueRepresentation::String) { +    if (!TlsAllocState->UseRefLocking && RepresentationKind_ == EValueRepresentation::String) {          /// TODO: YQL-4461 -        return MakeString(UnboxedValue.AsStringRef()); +        return MakeString(UnboxedValue_.AsStringRef());      } -    return UnboxedValue; +    return UnboxedValue_;  }  const IComputationNode* TUnboxedImmutableComputationNode::GetSource() const { return nullptr; } @@ -81,23 +81,23 @@ void TUnboxedImmutableComputationNode::PrepareStageOne() {}  void TUnboxedImmutableComputationNode::PrepareStageTwo() {}  TString TUnboxedImmutableComputationNode::DebugString() const { -    return UnboxedValue ? (UnboxedValue.IsBoxed() ? "Boxed" : "Literal") : "Empty"; +    return UnboxedValue_ ? (UnboxedValue_.IsBoxed() ? "Boxed" : "Literal") : "Empty";  }  EValueRepresentation TUnboxedImmutableComputationNode::GetRepresentation() const { -    return RepresentationKind; +    return RepresentationKind_;  }  Y_NO_INLINE TStatefulComputationNodeBase::TStatefulComputationNodeBase(ui32 valueIndex, EValueRepresentation kind) -    : ValueIndex(valueIndex) -    , RepresentationKind(kind) +    : ValueIndex_(valueIndex) +    , RepresentationKind_(kind)  {}  Y_NO_INLINE TStatefulComputationNodeBase::~TStatefulComputationNodeBase()  {}  Y_NO_INLINE void TStatefulComputationNodeBase::AddDependenceImpl(const IComputationNode* node) { -    Dependencies.emplace_back(node); +    Dependencies_.emplace_back(node);  }  Y_NO_INLINE void TStatefulComputationNodeBase::CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner, @@ -105,8 +105,8 @@ Y_NO_INLINE void TStatefulComputationNodeBase::CollectDependentIndexesImpl(const      if (self == owner)          return; -    if (const auto ins = dependencies.emplace(ValueIndex, RepresentationKind); ins.second) { -        std::for_each(Dependencies.cbegin(), Dependencies.cend(), std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, owner, std::ref(dependencies))); +    if (const auto ins = dependencies.emplace(ValueIndex_, RepresentationKind_); ins.second) { +        std::for_each(Dependencies_.cbegin(), Dependencies_.cend(), std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, owner, std::ref(dependencies)));          if (stateless) {              dependencies.erase(ins.first); @@ -122,14 +122,14 @@ Y_NO_INLINE TStatefulSourceComputationNodeBase::~TStatefulSourceComputationNodeB  {}  Y_NO_INLINE void TStatefulSourceComputationNodeBase::PrepareStageOneImpl(const TConstComputationNodePtrVector& dependencies) { -    if (!Stateless) { -        Stateless = std::accumulate(dependencies.cbegin(), dependencies.cend(), 0, +    if (!Stateless_) { +        Stateless_ = std::accumulate(dependencies.cbegin(), dependencies.cend(), 0,              std::bind(std::plus<i32>(), std::placeholders::_1, std::bind(&IComputationNode::GetDependencyWeight, std::placeholders::_2))) <= 1;      }  }  Y_NO_INLINE void TStatefulSourceComputationNodeBase::AddSource(IComputationNode* source) const { -    Sources.emplace(source); +    Sources_.emplace(source);  }  template <class IComputationNodeInterface, bool SerializableState> @@ -137,7 +137,7 @@ TStatefulComputationNode<IComputationNodeInterface, SerializableState>::TStatefu      : TStatefulComputationNodeBase(mutables.CurValueIndex++, kind)  {      if constexpr (SerializableState) { -        mutables.SerializableValues.push_back(ValueIndex); +        mutables.SerializableValues.push_back(ValueIndex_);      }  } @@ -149,17 +149,17 @@ IComputationNode* TStatefulComputationNode<IComputationNodeInterface, Serializab  template <class IComputationNodeInterface, bool SerializableState>  EValueRepresentation TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetRepresentation() const { -    return RepresentationKind; +    return RepresentationKind_;  }  template <class IComputationNodeInterface, bool SerializableState>  void TStatefulComputationNode<IComputationNodeInterface, SerializableState>::InitNode(TComputationContext&) const {}  template <class IComputationNodeInterface, bool SerializableState> -ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetIndex() const { return ValueIndex; } +ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetIndex() const { return ValueIndex_; }  template <class IComputationNodeInterface, bool SerializableState> -ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetDependencesCount() const { return Dependencies.size(); } +ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetDependencesCount() const { return Dependencies_.size(); }  template class TStatefulComputationNode<IComputationNode, false>;  template class TStatefulComputationNode<IComputationWideFlowNode, false>; @@ -184,8 +184,8 @@ Y_NO_INLINE void TStatelessFlowComputationNodeBase::CollectDependentIndexesImpl(  }  Y_NO_INLINE TStatefulFlowComputationNodeBase::TStatefulFlowComputationNodeBase(ui32 stateIndex, EValueRepresentation stateKind) -    : StateIndex(stateIndex) -    , StateKind(stateKind) +    : StateIndex_(stateIndex) +    , StateKind_(stateKind)  {}  Y_NO_INLINE void TStatefulFlowComputationNodeBase::CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner, @@ -193,16 +193,16 @@ Y_NO_INLINE void TStatefulFlowComputationNodeBase::CollectDependentIndexesImpl(c      if (self == owner)          return; -    const auto ins = dependencies.emplace(StateIndex, StateKind); +    const auto ins = dependencies.emplace(StateIndex_, StateKind_);      if (ins.second && dependence) {          dependence->CollectDependentIndexes(owner, dependencies);      }  }  Y_NO_INLINE TPairStateFlowComputationNodeBase::TPairStateFlowComputationNodeBase(ui32 stateIndex, EValueRepresentation firstKind, EValueRepresentation secondKind) -    : StateIndex(stateIndex) -    , FirstKind(firstKind) -    , SecondKind(secondKind) +    : StateIndex_(stateIndex) +    , FirstKind_(firstKind) +    , SecondKind_(secondKind)  {}  Y_NO_INLINE void TPairStateFlowComputationNodeBase::CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner, @@ -210,8 +210,8 @@ Y_NO_INLINE void TPairStateFlowComputationNodeBase::CollectDependentIndexesImpl(      if (self == owner)          return; -    const auto ins1 = dependencies.emplace(StateIndex, FirstKind); -    const auto ins2 = dependencies.emplace(StateIndex + 1U, SecondKind); +    const auto ins1 = dependencies.emplace(StateIndex_, FirstKind_); +    const auto ins2 = dependencies.emplace(StateIndex_ + 1U, SecondKind_);      if (ins1.second && ins2.second && dependence) {          dependence->CollectDependentIndexes(owner, dependencies);      } @@ -240,8 +240,8 @@ Y_NO_INLINE NUdf::TUnboxedValue TWideFlowBaseComputationNodeBase::GetValueImpl(T  }  Y_NO_INLINE TStatefulWideFlowComputationNodeBase::TStatefulWideFlowComputationNodeBase(ui32 stateIndex, EValueRepresentation stateKind) -    : StateIndex(stateIndex) -    , StateKind(stateKind) +    : StateIndex_(stateIndex) +    , StateKind_(stateKind)  {}  Y_NO_INLINE void TStatefulWideFlowComputationNodeBase::CollectDependentIndexesImpl(const IComputationNode* self, @@ -249,7 +249,7 @@ Y_NO_INLINE void TStatefulWideFlowComputationNodeBase::CollectDependentIndexesIm      if (self == owner)          return; -    const auto ins = dependencies.emplace(StateIndex, StateKind); +    const auto ins = dependencies.emplace(StateIndex_, StateKind_);      if (ins.second && dependence) {          dependence->CollectDependentIndexes(owner, dependencies);      } @@ -257,9 +257,9 @@ Y_NO_INLINE void TStatefulWideFlowComputationNodeBase::CollectDependentIndexesIm  Y_NO_INLINE TPairStateWideFlowComputationNodeBase::TPairStateWideFlowComputationNodeBase(      ui32 stateIndex, EValueRepresentation firstKind, EValueRepresentation secondKind) -    : StateIndex(stateIndex) -    , FirstKind(firstKind) -    , SecondKind(secondKind) +    : StateIndex_(stateIndex) +    , FirstKind_(firstKind) +    , SecondKind_(secondKind)  {}  Y_NO_INLINE void TPairStateWideFlowComputationNodeBase::CollectDependentIndexesImpl( @@ -268,16 +268,16 @@ Y_NO_INLINE void TPairStateWideFlowComputationNodeBase::CollectDependentIndexesI      if (self == owner)          return; -    const auto ins1 = dependencies.emplace(StateIndex, FirstKind); -    const auto ins2 = dependencies.emplace(StateIndex + 1U, SecondKind); +    const auto ins1 = dependencies.emplace(StateIndex_, FirstKind_); +    const auto ins2 = dependencies.emplace(StateIndex_ + 1U, SecondKind_);      if (ins1.second && ins2.second && dependence) {          dependence->CollectDependentIndexes(owner, dependencies);      }  }  Y_NO_INLINE TDecoratorComputationNodeBase::TDecoratorComputationNodeBase(IComputationNode* node, EValueRepresentation kind) -    : Node(node) -    , Kind(kind) +    : Node_(node) +    , Kind_(kind)  {}  Y_NO_INLINE ui32 TDecoratorComputationNodeBase::GetIndexImpl() const { @@ -285,13 +285,13 @@ Y_NO_INLINE ui32 TDecoratorComputationNodeBase::GetIndexImpl() const {  }  Y_NO_INLINE TString TDecoratorComputationNodeBase::DebugStringImpl(const TString& typeName) const { -    return typeName + "(" + Node->DebugString() + ")"; +    return typeName + "(" + Node_->DebugString() + ")";  }  Y_NO_INLINE TBinaryComputationNodeBase::TBinaryComputationNodeBase(IComputationNode* left, IComputationNode* right, EValueRepresentation kind) -    : Left(left) -    , Right(right) -    , Kind(kind) +    : Left_(left) +    , Right_(right) +    , Kind_(kind)  {}  Y_NO_INLINE ui32 TBinaryComputationNodeBase::GetIndexImpl() const { @@ -299,21 +299,21 @@ Y_NO_INLINE ui32 TBinaryComputationNodeBase::GetIndexImpl() const {  }  Y_NO_INLINE TString TBinaryComputationNodeBase::DebugStringImpl(const TString& typeName) const { -    return typeName + "(" + Left->DebugString() + "," + Right->DebugString() + ")"; +    return typeName + "(" + Left_->DebugString() + "," + Right_->DebugString() + ")";  }  void TExternalComputationNode::CollectDependentIndexes(const IComputationNode*, TIndexesMap& map) const { -    map.emplace(ValueIndex, RepresentationKind); +    map.emplace(ValueIndex_, RepresentationKind_);  }  TExternalComputationNode::TExternalComputationNode(TComputationMutables& mutables, EValueRepresentation kind)      : TStatefulComputationNode(mutables, kind)  { -    mutables.CachedValues.push_back(ValueIndex); +    mutables.CachedValues.push_back(ValueIndex_);  }  NUdf::TUnboxedValue TExternalComputationNode::GetValue(TComputationContext& ctx) const { -    return Getter ? Getter(ctx) : ValueRef(ctx); +    return Getter_ ? Getter_(ctx) : ValueRef(ctx);  }  NUdf::TUnboxedValue& TExternalComputationNode::RefValue(TComputationContext& ctx) const { @@ -333,22 +333,22 @@ TString TExternalComputationNode::DebugString() const {  void TExternalComputationNode::RegisterDependencies() const {}  void TExternalComputationNode::SetOwner(const IComputationNode* owner) { -    Y_DEBUG_ABORT_UNLESS(!Owner); -    Owner = owner; +    Y_DEBUG_ABORT_UNLESS(!Owner_); +    Owner_ = owner;  }  void TExternalComputationNode::PrepareStageOne() { -    std::sort(Dependencies.begin(), Dependencies.end()); -    Dependencies.erase(std::unique(Dependencies.begin(), Dependencies.end()), Dependencies.cend()); -    if (const auto it = std::find(Dependencies.cbegin(), Dependencies.cend(), Owner); Dependencies.cend() != it) -        Dependencies.erase(it); +    std::sort(Dependencies_.begin(), Dependencies_.end()); +    Dependencies_.erase(std::unique(Dependencies_.begin(), Dependencies_.end()), Dependencies_.cend()); +    if (const auto it = std::find(Dependencies_.cbegin(), Dependencies_.cend(), Owner_); Dependencies_.cend() != it) +        Dependencies_.erase(it);  }  void TExternalComputationNode::PrepareStageTwo() {      TIndexesMap dependencies; -    std::for_each(Dependencies.cbegin(), Dependencies.cend(), -        std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, Owner, std::ref(dependencies))); -    InvalidationSet.assign(dependencies.cbegin(), dependencies.cend()); +    std::for_each(Dependencies_.cbegin(), Dependencies_.cend(), +        std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, Owner_, std::ref(dependencies))); +    InvalidationSet_.assign(dependencies.cbegin(), dependencies.cend());  }  const IComputationNode* TExternalComputationNode::GetSource() const { return nullptr; } @@ -356,15 +356,15 @@ const IComputationNode* TExternalComputationNode::GetSource() const { return nul  ui32 TExternalComputationNode::GetDependencyWeight() const { return 0U; }  bool TExternalComputationNode::IsTemporaryValue() const { -    return bool(Getter); +    return bool(Getter_);  }  void TExternalComputationNode::SetGetter(TGetter&& getter) { -    Getter = std::move(getter); +    Getter_ = std::move(getter);  }  void TExternalComputationNode::InvalidateValue(TComputationContext& ctx) const { -    for (const auto& index : InvalidationSet) { +    for (const auto& index : InvalidationSet_) {          ctx.MutableValues[index.first] = NUdf::TUnboxedValuePod::Invalid();      }  } @@ -609,12 +609,12 @@ ui32 TWideFlowProxyComputationNode::GetDependencyWeight() const {  }  ui32 TWideFlowProxyComputationNode::GetDependencesCount() const { -    return Dependence ? 1U : 0U; +    return Dependence_ ? 1U : 0U;  }  IComputationNode* TWideFlowProxyComputationNode::AddDependence(const IComputationNode* node) { -    Y_DEBUG_ABORT_UNLESS(!Dependence); -    Dependence = node; +    Y_DEBUG_ABORT_UNLESS(!Dependence_); +    Dependence_ = node;      return this;  } @@ -627,16 +627,16 @@ void TWideFlowProxyComputationNode::RegisterDependencies() const {}  void TWideFlowProxyComputationNode::PrepareStageOne() {}  void TWideFlowProxyComputationNode::PrepareStageTwo() { -    if (Dependence) { +    if (Dependence_) {          TIndexesMap dependencies; -        Dependence->CollectDependentIndexes(Owner, dependencies); -        InvalidationSet.assign(dependencies.cbegin(), dependencies.cend()); +        Dependence_->CollectDependentIndexes(Owner_, dependencies); +        InvalidationSet_.assign(dependencies.cbegin(), dependencies.cend());      }  }  void TWideFlowProxyComputationNode::SetOwner(const IComputationNode* owner) { -    Y_DEBUG_ABORT_UNLESS(!Owner); -    Owner = owner; +    Y_DEBUG_ABORT_UNLESS(!Owner_); +    Owner_ = owner;  }  void TWideFlowProxyComputationNode::CollectDependentIndexes(const IComputationNode*, TIndexesMap&) const { @@ -644,17 +644,17 @@ void TWideFlowProxyComputationNode::CollectDependentIndexes(const IComputationNo  }  void TWideFlowProxyComputationNode::InvalidateValue(TComputationContext& ctx) const { -    for (const auto& index : InvalidationSet) { +    for (const auto& index : InvalidationSet_) {          ctx.MutableValues[index.first] = NUdf::TUnboxedValuePod::Invalid();      }  }  void TWideFlowProxyComputationNode::SetFetcher(TFetcher&& fetcher) { -    Fetcher = std::move(fetcher); +    Fetcher_ = std::move(fetcher);  }  EFetchResult TWideFlowProxyComputationNode::FetchValues(TComputationContext& ctx, NUdf::TUnboxedValue*const* values) const { -    return Fetcher(ctx, values); +    return Fetcher_(ctx, values);  }  IComputationNode* LocateNode(const TNodeLocator& nodeLocator, TCallable& callable, ui32 index, bool pop) { diff --git a/yql/essentials/minikql/computation/mkql_computation_node_impl.h b/yql/essentials/minikql/computation/mkql_computation_node_impl.h index 92e2c76c6e4..7093829ed27 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_impl.h +++ b/yql/essentials/minikql/computation/mkql_computation_node_impl.h @@ -69,10 +69,10 @@ private:      EValueRepresentation GetRepresentation() const final; -    TMemoryUsageInfo *const MemInfo; +    TMemoryUsageInfo *const MemInfo_;  protected: -    const NUdf::TUnboxedValue UnboxedValue; -    const EValueRepresentation RepresentationKind; +    const NUdf::TUnboxedValue UnboxedValue_; +    const EValueRepresentation RepresentationKind_;  };  class TStatefulComputationNodeBase { @@ -83,10 +83,10 @@ protected:      void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,          IComputationNode::TIndexesMap& dependencies, bool stateless) const; -    TConstComputationNodePtrVector Dependencies; +    TConstComputationNodePtrVector Dependencies_; -    const ui32 ValueIndex; -    const EValueRepresentation RepresentationKind; +    const ui32 ValueIndex_; +    const EValueRepresentation RepresentationKind_;  };  template <class IComputationNodeInterface, bool SerializableState = false> @@ -105,7 +105,7 @@ protected:      EValueRepresentation GetRepresentation() const override;      NUdf::TUnboxedValue& ValueRef(TComputationContext& compCtx) const { -        return compCtx.MutableValues[ValueIndex]; +        return compCtx.MutableValues[ValueIndex_];      }  private: @@ -139,7 +139,7 @@ private:      bool IsTemporaryValue() const final; -    const IComputationNode* Owner = nullptr; +    const IComputationNode* Owner_ = nullptr;      void SetGetter(TGetter&& getter) final; @@ -147,8 +147,8 @@ private:      const IComputationNode* GetSource() const final;  protected: -    std::vector<std::pair<ui32, EValueRepresentation>> InvalidationSet; -    TGetter Getter; +    std::vector<std::pair<ui32, EValueRepresentation>> InvalidationSet_; +    TGetter Getter_;  };  class TStatefulSourceComputationNodeBase { @@ -158,8 +158,8 @@ protected:      void PrepareStageOneImpl(const TConstComputationNodePtrVector& dependencies);      void AddSource(IComputationNode* source) const; -    mutable std::unordered_set<const IComputationNode*> Sources; // TODO: remove const and mutable. -    std::optional<bool> Stateless; +    mutable std::unordered_set<const IComputationNode*> Sources_; // TODO: remove const and mutable. +    std::optional<bool> Stateless_;  };  template <typename TDerived, bool SerializableState = false> @@ -169,21 +169,21 @@ class TStatefulSourceComputationNode: public TStatefulComputationNode<IComputati      using TStatefulComputationNode = TStatefulComputationNode<IComputationNode, SerializableState>;  private:      bool IsTemporaryValue() const final { -        return *Stateless; +        return *Stateless_;      }      ui32 GetDependencyWeight() const final { -        return Sources.size(); +        return Sources_.size();      }      void PrepareStageOne() final { -        PrepareStageOneImpl(this->Dependencies); +        PrepareStageOneImpl(this->Dependencies_);      }      void PrepareStageTwo() final {}      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        this->CollectDependentIndexesImpl(this, owner, dependencies, *Stateless); +        this->CollectDependentIndexesImpl(this, owner, dependencies, *Stateless_);      }      const IComputationNode* GetSource() const final { return this; } @@ -217,7 +217,7 @@ protected:      using TStatefulSourceComputationNode<TDerived>::TStatefulSourceComputationNode;      NUdf::TUnboxedValue GetValue(TComputationContext& compCtx) const override { -        if (*this->Stateless) +        if (*this->Stateless_)              return static_cast<const TDerived*>(this)->DoCalculate(compCtx);          NUdf::TUnboxedValue& valueRef = this->ValueRef(compCtx);          if (valueRef.IsInvalid()) { @@ -244,7 +244,7 @@ protected:      void DependsOn(IComputationNode* node) const {          if (node) {              if (const auto source = node->AddDependence(this)) { -                Sources.emplace(source); +                Sources_.emplace(source);              }          }      } @@ -260,7 +260,7 @@ private:      }      ui32 GetDependencyWeight() const final { -        return this->Dependencies.size() + Sources.size(); +        return this->Dependencies_.size() + Sources_.size();      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationExternalNode::TIndexesMap& dependencies) const final { @@ -272,7 +272,7 @@ private:      const IComputationNode* GetSource() const final { return this; } -    mutable std::unordered_set<const IComputationNode*> Sources; // TODO: remove const and mutable. +    mutable std::unordered_set<const IComputationNode*> Sources_; // TODO: remove const and mutable.  };  template <typename TDerived> @@ -281,19 +281,19 @@ class TFlowSourceComputationNode: public TFlowSourceBaseComputationNode<TDerived      using TBase = TFlowSourceBaseComputationNode<TDerived, IComputationNode>;  protected:      TFlowSourceComputationNode(TComputationMutables& mutables, EValueRepresentation kind, EValueRepresentation stateKind) -        : TBase(mutables, stateKind), RepresentationKind(kind) +        : TBase(mutables, stateKind), RepresentationKind_(kind)      {}  private:      EValueRepresentation GetRepresentation() const final { -        return RepresentationKind; +        return RepresentationKind_;      }      NUdf::TUnboxedValue GetValue(TComputationContext& compCtx) const final {          return static_cast<const TDerived*>(this)->DoCalculate(this->ValueRef(compCtx), compCtx);      }  private: -    const EValueRepresentation RepresentationKind; +    const EValueRepresentation RepresentationKind_;  };  template <typename TDerived> @@ -322,7 +322,7 @@ template <typename TDerived, typename IFlowInterface>  class TFlowBaseComputationNode: public TRefCountedComputationNode<IFlowInterface>  {  protected: -    TFlowBaseComputationNode(const IComputationNode* source) : Source(source) {} +    TFlowBaseComputationNode(const IComputationNode* source) : Source_(source) {}      void InitNode(TComputationContext&) const override {} @@ -395,12 +395,12 @@ private:      ui32 GetDependencyWeight() const final { return 42U; }      ui32 GetDependencesCount() const final { -        return Dependence ? 1U : 0U; +        return Dependence_ ? 1U : 0U;      }      IComputationNode* AddDependence(const IComputationNode* node) final { -        if (!Dependence) { -            Dependence = node; +        if (!Dependence_) { +            Dependence_ = node;          }          return this;      } @@ -413,14 +413,14 @@ private:      void PrepareStageTwo() final {}      const IComputationNode* GetSource() const final { -        if (Source && Source != this) -            if (const auto s = Source->GetSource()) +        if (Source_ && Source_ != this) +            if (const auto s = Source_->GetSource())                  return s;          return this;      }  protected: -    const IComputationNode *const Source; -    const IComputationNode *Dependence = nullptr; +    const IComputationNode *const Source_; +    const IComputationNode *Dependence_ = nullptr;  };  template <typename TDerived> @@ -428,20 +428,20 @@ class TBaseFlowBaseComputationNode: public TFlowBaseComputationNode<TDerived, IC  {  protected:      TBaseFlowBaseComputationNode(const IComputationNode* source, EValueRepresentation kind) -        : TFlowBaseComputationNode<TDerived, IComputationNode>(source), RepresentationKind(kind) +        : TFlowBaseComputationNode<TDerived, IComputationNode>(source), RepresentationKind_(kind)      {}  private:      EValueRepresentation GetRepresentation() const final { -        return RepresentationKind; +        return RepresentationKind_;      } -    const EValueRepresentation RepresentationKind; +    const EValueRepresentation RepresentationKind_;  };  class TStatelessFlowComputationNodeBase {  protected:      ui32 GetIndexImpl() const; -    void CollectDependentIndexesImpl(const IComputationNode* self,  +    void CollectDependentIndexesImpl(const IComputationNode* self,          const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies,          const IComputationNode* dependence) const;  }; @@ -467,18 +467,18 @@ private:      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence); +        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence_);      }  };  class TStatefulFlowComputationNodeBase {  protected:      TStatefulFlowComputationNodeBase(ui32 stateIndex, EValueRepresentation stateKind); -    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,  +    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,          IComputationNode::TIndexesMap& dependencies, const IComputationNode* dependence) const; -    const ui32 StateIndex; -    const EValueRepresentation StateKind; +    const ui32 StateIndex_; +    const EValueRepresentation StateKind_;  };  template <typename TDerived, bool SerializableState = false> @@ -489,7 +489,7 @@ protected:          : TBaseFlowBaseComputationNode<TDerived>(source, kind), TStatefulFlowComputationNodeBase(mutables.CurValueIndex++, stateKind)      {          if constexpr (SerializableState) { -            mutables.SerializableValues.push_back(StateIndex); +            mutables.SerializableValues.push_back(StateIndex_);          }      } @@ -499,15 +499,15 @@ protected:  private:      ui32 GetIndex() const final { -        return StateIndex; +        return StateIndex_;      }      NUdf::TUnboxedValue GetValue(TComputationContext& compCtx) const final { -        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex], compCtx); +        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex_], compCtx);      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence); +        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence_);      }  }; @@ -516,11 +516,11 @@ const IComputationNode* GetCommonSource(const IComputationNode* first, const ICo  class TPairStateFlowComputationNodeBase {  protected:      TPairStateFlowComputationNodeBase(ui32 stateIndex, EValueRepresentation firstKind, EValueRepresentation secondKind); -    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,  +    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,          IComputationNode::TIndexesMap& dependencies, const IComputationNode* dependence) const; -    const ui32 StateIndex; -    const EValueRepresentation FirstKind, SecondKind; +    const ui32 StateIndex_; +    const EValueRepresentation FirstKind_, SecondKind_;  };  template <typename TDerived> @@ -535,15 +535,15 @@ protected:  private:      NUdf::TUnboxedValue GetValue(TComputationContext& compCtx) const final { -        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex], compCtx.MutableValues[StateIndex + 1U], compCtx); +        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex_], compCtx.MutableValues[StateIndex_ + 1U], compCtx);      }      ui32 GetIndex() const final { -        return StateIndex; +        return StateIndex_;      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence); +        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence_);      }  }; @@ -589,10 +589,10 @@ private:      EFetchResult FetchValues(TComputationContext& ctx, NUdf::TUnboxedValue*const* values) const final;  protected: -    const IComputationNode* Dependence = nullptr; -    const IComputationNode* Owner = nullptr; -    std::vector<std::pair<ui32, EValueRepresentation>> InvalidationSet; -    TFetcher Fetcher; +    const IComputationNode* Dependence_ = nullptr; +    const IComputationNode* Owner_ = nullptr; +    std::vector<std::pair<ui32, EValueRepresentation>> InvalidationSet_; +    TFetcher Fetcher_;  };  class TWideFlowBaseComputationNodeBase { @@ -602,7 +602,7 @@ protected:  };  template <typename TDerived> -class TWideFlowBaseComputationNode: public TFlowBaseComputationNode<TDerived, IComputationWideFlowNode>,  +class TWideFlowBaseComputationNode: public TFlowBaseComputationNode<TDerived, IComputationWideFlowNode>,      protected TWideFlowBaseComputationNodeBase  {  protected: @@ -622,7 +622,7 @@ private:  class TStatelessWideFlowComputationNodeBase {  protected:      ui32 GetIndexImpl() const; -    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,  +    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,          IComputationNode::TIndexesMap& dependencies, const IComputationNode* dependence) const;  }; @@ -644,7 +644,7 @@ private:      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence); +        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence_);      }  }; @@ -654,8 +654,8 @@ protected:      void CollectDependentIndexesImpl(const IComputationNode* self,          const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies, const IComputationNode* dependence) const; -    const ui32 StateIndex; -    const EValueRepresentation StateKind; +    const ui32 StateIndex_; +    const EValueRepresentation StateKind_;  };  template <typename TDerived, bool SerializableState = false> @@ -666,7 +666,7 @@ protected:          : TWideFlowBaseComputationNode<TDerived>(source), TStatefulWideFlowComputationNodeBase(mutables.CurValueIndex++, stateKind)      {          if constexpr (SerializableState) { -            mutables.SerializableValues.push_back(StateIndex); +            mutables.SerializableValues.push_back(StateIndex_);          }      } @@ -675,26 +675,26 @@ protected:      }  private:      EFetchResult FetchValues(TComputationContext& compCtx, NUdf::TUnboxedValue*const* values) const final { -        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex], compCtx, values); +        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex_], compCtx, values);      }      ui32 GetIndex() const final { -        return StateIndex; +        return StateIndex_;      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence); +        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence_);      }  };  class TPairStateWideFlowComputationNodeBase {  protected:      TPairStateWideFlowComputationNodeBase(ui32 stateIndex, EValueRepresentation firstKind, EValueRepresentation secondKind); -    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner,  -        IComputationNode::TIndexesMap& dependencies, const IComputationNode* dependence) const;     +    void CollectDependentIndexesImpl(const IComputationNode* self, const IComputationNode* owner, +        IComputationNode::TIndexesMap& dependencies, const IComputationNode* dependence) const; -    const ui32 StateIndex; -    const EValueRepresentation FirstKind, SecondKind; +    const ui32 StateIndex_; +    const EValueRepresentation FirstKind_, SecondKind_;  };  template <typename TDerived> @@ -709,15 +709,15 @@ protected:  private:      EFetchResult FetchValues(TComputationContext& compCtx, NUdf::TUnboxedValue*const* values) const final { -        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex], compCtx.MutableValues[StateIndex + 1U], compCtx, values); +        return static_cast<const TDerived*>(this)->DoCalculate(compCtx.MutableValues[StateIndex_], compCtx.MutableValues[StateIndex_ + 1U], compCtx, values);      }      ui32 GetIndex() const final { -        return StateIndex; +        return StateIndex_;      }      void CollectDependentIndexes(const IComputationNode* owner, IComputationNode::TIndexesMap& dependencies) const final { -        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence); +        CollectDependentIndexesImpl(this, owner, dependencies, this->Dependence_);      }  }; @@ -727,8 +727,8 @@ protected:      ui32 GetIndexImpl() const;      TString DebugStringImpl(const TString& typeName) const; -    IComputationNode *const Node; -    const EValueRepresentation Kind; +    IComputationNode *const Node_; +    const EValueRepresentation Kind_;  };  template <typename TDerived> @@ -737,26 +737,26 @@ class TDecoratorComputationNode: public TRefCountedComputationNode<IComputationN  private:      void InitNode(TComputationContext&) const final {} -    const IComputationNode* GetSource() const final { return Node; } +    const IComputationNode* GetSource() const final { return Node_; }      IComputationNode* AddDependence(const IComputationNode* node) final { -        return Node->AddDependence(node); +        return Node_->AddDependence(node);      } -    EValueRepresentation GetRepresentation() const final { return Kind; } +    EValueRepresentation GetRepresentation() const final { return Kind_; }      bool IsTemporaryValue() const final { return true; }      void PrepareStageOne() final {}      void PrepareStageTwo() final {} -    void RegisterDependencies() const final { Node->AddDependence(this); } +    void RegisterDependencies() const final { Node_->AddDependence(this); }      void CollectDependentIndexes(const IComputationNode*, TIndexesMap&) const final {}      ui32 GetDependencyWeight() const final { return 0U; }      ui32 GetDependencesCount() const final { -        return Node->GetDependencesCount(); +        return Node_->GetDependencesCount();      }      ui32 GetIndex() const final { @@ -764,7 +764,7 @@ private:      }      NUdf::TUnboxedValue GetValue(TComputationContext& compCtx) const final { -        return static_cast<const TDerived*>(this)->DoCalculate(compCtx, Node->GetValue(compCtx)); +        return static_cast<const TDerived*>(this)->DoCalculate(compCtx, Node_->GetValue(compCtx));      }  protected: @@ -788,9 +788,9 @@ protected:      ui32 GetIndexImpl() const;      TString DebugStringImpl(const TString& typeName) const; -    IComputationNode *const Left; -    IComputationNode *const Right; -    const EValueRepresentation Kind; +    IComputationNode *const Left_; +    IComputationNode *const Right_; +    const EValueRepresentation Kind_;  };  template <typename TDerived> @@ -802,7 +802,7 @@ private:      }      const IComputationNode* GetSource() const final { -        return GetCommonSource(Left, Right, this); +        return GetCommonSource(Left_, Right_, this);      }      void InitNode(TComputationContext&) const final {} @@ -812,8 +812,8 @@ protected:      }      IComputationNode* AddDependence(const IComputationNode* node) final { -        const auto l = Left->AddDependence(node); -        const auto r = Right->AddDependence(node); +        const auto l = Left_->AddDependence(node); +        const auto r = Right_->AddDependence(node);          if (!l) return r;          if (!r) return l; @@ -822,7 +822,7 @@ protected:      }      EValueRepresentation GetRepresentation() const final { -        return Kind; +        return Kind_;      }      bool IsTemporaryValue() const final { return true; } @@ -831,8 +831,8 @@ protected:      void PrepareStageTwo() final {}      void RegisterDependencies() const final { -        Left->AddDependence(this); -        Right->AddDependence(this); +        Left_->AddDependence(this); +        Right_->AddDependence(this);      }      void CollectDependentIndexes(const IComputationNode*, TIndexesMap&) const final {} @@ -840,7 +840,7 @@ protected:      ui32 GetDependencyWeight() const final { return 0U; }      ui32 GetDependencesCount() const final { -        return Left->GetDependencesCount() + Right->GetDependencesCount(); +        return Left_->GetDependencesCount() + Right_->GetDependencesCount();      }      ui32 GetIndex() const final { diff --git a/yql/essentials/minikql/computation/mkql_computation_node_list.h b/yql/essentials/minikql/computation/mkql_computation_node_list.h index 66faa760448..0e2a744deb6 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_list.h +++ b/yql/essentials/minikql/computation/mkql_computation_node_list.h @@ -125,47 +125,47 @@ namespace NKikimr {              struct TIterator {                  TIterator() -                    : Owner_(nullptr) -                    , Position_(nullptr) +                    : Owner(nullptr) +                    , Position(nullptr)                  {}                  TIterator(const TListRepresentation& owner) -                    : Owner_(&owner) -                    , Position_(owner.Begin_) +                    : Owner(&owner) +                    , Position(owner.Begin_)                  {                  }                  TIterator(const TIterator& other) -                    : Owner_(other.Owner_) -                    , Position_(other.Position_) +                    : Owner(other.Owner) +                    , Position(other.Position)                  {}                  TIterator& operator=(const TIterator& other)                  { -                    Owner_ = other.Owner_; -                    Position_ = other.Position_; +                    Owner = other.Owner; +                    Position = other.Position;                      return *this;                  }                  bool AtEnd() const { -                    return Position_ == Owner_->End_; +                    return Position == Owner->End_;                  }                  const T& Current() const { -                    return *Position_; +                    return *Position;                  }                  // use with care, list may be shared                  T& MutableCurrent() { -                    return *Position_; +                    return *Position;                  }                  void Next() { -                    Position_++; +                    Position++;                  } -                const TListRepresentation* Owner_; -                T* Position_; +                const TListRepresentation* Owner; +                T* Position;              };              struct TReverseIterator { @@ -182,8 +182,8 @@ namespace NKikimr {                  }                  TReverseIterator(const TIterator& other) -                    : Owner_(other.Owner_) -                    , Position_(other.Position_) +                    : Owner_(other.Owner) +                    , Position_(other.Position)                  {                  } diff --git a/yql/essentials/minikql/computation/mkql_computation_node_pack_ut.cpp b/yql/essentials/minikql/computation/mkql_computation_node_pack_ut.cpp index 19bca68b95f..b13acb40a62 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_pack_ut.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_pack_ut.cpp @@ -59,13 +59,13 @@ class TMiniKQLComputationNodePackTest: public TTestBase {      using TValuePackerType = typename TPackerTraits<Fast, Transport>::TPackerType;  protected:      TMiniKQLComputationNodePackTest() -        : FunctionRegistry(CreateFunctionRegistry(CreateBuiltinRegistry())) -        , RandomProvider(CreateDefaultRandomProvider()) -        , Alloc(__LOCATION__) -        , Env(Alloc) -        , PgmBuilder(Env, *FunctionRegistry) -        , MemInfo("Memory") -        , HolderFactory(Alloc.Ref(), MemInfo, FunctionRegistry.Get()) +        : FunctionRegistry_(CreateFunctionRegistry(CreateBuiltinRegistry())) +        , RandomProvider_(CreateDefaultRandomProvider()) +        , Alloc_(__LOCATION__) +        , Env_(Alloc_) +        , PgmBuilder_(Env_, *FunctionRegistry_) +        , MemInfo_("Memory") +        , HolderFactory_(Alloc_.Ref(), MemInfo_, FunctionRegistry_.Get())          , ArrowPool_(NYql::NUdf::GetYqlMemoryPool())      {      } @@ -111,8 +111,8 @@ protected:          for (ui32 val: xrange(0, 10)) {              listValues = listValues.Append(NUdf::TUnboxedValuePod(val));          } -        TType* listType = PgmBuilder.NewListType(PgmBuilder.NewDataType(NUdf::TDataType<ui32>::Id)); -        const NUdf::TUnboxedValue value = HolderFactory.CreateDirectListHolder(std::move(listValues)); +        TType* listType = PgmBuilder_.NewListType(PgmBuilder_.NewDataType(NUdf::TDataType<ui32>::Id)); +        const NUdf::TUnboxedValue value = HolderFactory_.CreateDirectListHolder(std::move(listValues));          const auto uValue = TestPackUnpack(listType, value, "Type:List(ui32)");          UNIT_ASSERT_VALUES_EQUAL(uValue.GetListLength(), 10); @@ -133,8 +133,8 @@ protected:              }              listValues = listValues.Append(std::move(uVal));          } -        TType* listType = PgmBuilder.NewListType(PgmBuilder.NewOptionalType(PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id))); -        const NUdf::TUnboxedValue value = HolderFactory.CreateDirectListHolder(std::move(listValues)); +        TType* listType = PgmBuilder_.NewListType(PgmBuilder_.NewOptionalType(PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id))); +        const NUdf::TUnboxedValue value = HolderFactory_.CreateDirectListHolder(std::move(listValues));          const auto uValue = TestPackUnpack(listType, value, "Type:List(Optional(utf8))");          UNIT_ASSERT_VALUES_EQUAL(uValue.GetListLength(), 10); @@ -153,13 +153,13 @@ protected:      void TestTupleType() {          std::vector<TType*> tupleElemenTypes; -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[0])); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[0])); -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id)); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[3])); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[3])); -        TType* tupleType = PgmBuilder.NewTupleType(tupleElemenTypes); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[0])); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[0])); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id)); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[3])); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[3])); +        TType* tupleType = PgmBuilder_.NewTupleType(tupleElemenTypes);          TUnboxedValueVector tupleElemens;          tupleElemens.push_back(MakeString("01234567890123456789")); @@ -169,7 +169,7 @@ protected:          tupleElemens.push_back(NUdf::TUnboxedValuePod());          tupleElemens.push_back(NUdf::TUnboxedValuePod(ui64(12345))); -        const NUdf::TUnboxedValue value = HolderFactory.VectorAsArray(tupleElemens); +        const NUdf::TUnboxedValue value = HolderFactory_.VectorAsArray(tupleElemens);          const auto uValue = TestPackUnpack(tupleType, value, "Type:Tuple");          { @@ -202,14 +202,14 @@ protected:      void TestStructType() {          const std::vector<std::pair<std::string_view, TType*>> structElemenTypes = { -            {"a", PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)}, -            {"b", PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id, true)}, -            {"c", PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id, true)}, -            {"d", PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id)}, -            {"e", PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id, true)}, -            {"f", PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id, true)} +            {"a", PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)}, +            {"b", PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id, true)}, +            {"c", PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id, true)}, +            {"d", PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id)}, +            {"e", PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id, true)}, +            {"f", PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id, true)}          }; -        TType* structType = PgmBuilder.NewStructType(structElemenTypes); +        TType* structType = PgmBuilder_.NewStructType(structElemenTypes);          TUnboxedValueVector structElemens;          structElemens.push_back(MakeString("01234567890123456789")); @@ -219,7 +219,7 @@ protected:          structElemens.push_back(NUdf::TUnboxedValuePod());          structElemens.push_back(NUdf::TUnboxedValuePod(ui64(12345))); -        const NUdf::TUnboxedValue value = HolderFactory.VectorAsArray(structElemens); +        const NUdf::TUnboxedValue value = HolderFactory_.VectorAsArray(structElemens);          const auto uValue = TestPackUnpack(structType, value, "Type:Struct");          { @@ -251,10 +251,10 @@ protected:      }      void TestOptionalType() { -        TType* type = PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id); -        type = PgmBuilder.NewOptionalType(type); -        type = PgmBuilder.NewOptionalType(type); -        type = PgmBuilder.NewOptionalType(type); +        TType* type = PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id); +        type = PgmBuilder_.NewOptionalType(type); +        type = PgmBuilder_.NewOptionalType(type); +        type = PgmBuilder_.NewOptionalType(type);          NUdf::TUnboxedValue uValue = NUdf::TUnboxedValuePod();          uValue = TestPackUnpack(type, uValue, "Type:Optional, Value:null"); @@ -280,15 +280,15 @@ protected:      }      void TestDictType() { -        TType* keyType = PgmBuilder.NewDataType(NUdf::TDataType<ui32>::Id); -        TType* payloadType = PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id); -        TType* dictType = PgmBuilder.NewDictType(keyType, payloadType, false); +        TType* keyType = PgmBuilder_.NewDataType(NUdf::TDataType<ui32>::Id); +        TType* payloadType = PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id); +        TType* dictType = PgmBuilder_.NewDictType(keyType, payloadType, false);          TValuesDictHashSingleFixedMap<ui32> map;          map[4] = NUdf::TUnboxedValuePod::Embedded("4");          map[10] = NUdf::TUnboxedValuePod::Embedded("10");          map[1] = NUdf::TUnboxedValuePod::Embedded("1"); -        const NUdf::TUnboxedValue value = HolderFactory.CreateDirectHashedSingleFixedMapHolder<ui32, false>(std::move(map), std::nullopt); +        const NUdf::TUnboxedValue value = HolderFactory_.CreateDirectHashedSingleFixedMapHolder<ui32, false>(std::move(map), std::nullopt);          const auto uValue = TestPackUnpack(dictType, value, "Type:Dict"); @@ -301,21 +301,21 @@ protected:      void TestVariantTypeOverStruct() {          const std::vector<std::pair<std::string_view, TType*>> structElemenTypes = { -            {"a", PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)}, -            {"b", PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id, true)}, -            {"d", PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id)} +            {"a", PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)}, +            {"b", PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id, true)}, +            {"d", PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id)}          }; -        TType* structType = PgmBuilder.NewStructType(structElemenTypes); -        TestVariantTypeImpl(PgmBuilder.NewVariantType(structType)); +        TType* structType = PgmBuilder_.NewStructType(structElemenTypes); +        TestVariantTypeImpl(PgmBuilder_.NewVariantType(structType));      }      void TestVariantTypeOverTuple() {          std::vector<TType*> tupleElemenTypes; -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[0])); -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id)); -        TType* tupleType = PgmBuilder.NewTupleType(tupleElemenTypes); -        TestVariantTypeImpl(PgmBuilder.NewVariantType(tupleType)); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[0])); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id)); +        TType* tupleType = PgmBuilder_.NewTupleType(tupleElemenTypes); +        TestVariantTypeImpl(PgmBuilder_.NewVariantType(tupleType));      }      void ValidateEmbeddedLength(TChunkedBuffer buf, const TString& info) { @@ -359,13 +359,13 @@ protected:                  UNIT_ASSERT_VALUES_EQUAL_C(packedValue.Size(), *expectedLength, additionalMsg);              }              ValidateEmbeddedLength(packedValue, additionalMsg); -            return packer.Unpack(std::move(packedValue), HolderFactory); +            return packer.Unpack(std::move(packedValue), HolderFactory_);          } else {              if (expectedLength) {                  UNIT_ASSERT_VALUES_EQUAL_C(packedValue.Size(), *expectedLength, additionalMsg);              }              ValidateEmbeddedLength(packedValue, additionalMsg); -            return packer.Unpack(packedValue, HolderFactory); +            return packer.Unpack(packedValue, HolderFactory_);          }      } @@ -386,7 +386,7 @@ protected:      template <typename T>      void TestNumericType(NUdf::TDataTypeId schemeType) {          TString typeDesc = TStringBuilder() << ", Type:" << NUdf::GetDataTypeInfo(NUdf::GetDataSlot(schemeType)).Name; -        TValuePackerType packer(false, PgmBuilder.NewDataType(schemeType)); +        TValuePackerType packer(false, PgmBuilder_.NewDataType(schemeType));          TestNumericValue<T>(Max<T>(), packer, typeDesc);          TestNumericValue<T>(Min<T>(), packer, typeDesc); @@ -411,7 +411,7 @@ protected:      template <typename T>      void TestOptionalNumericType(NUdf::TDataTypeId schemeType) {          TString typeDesc = TStringBuilder() << ", Type:Optional(" << NUdf::GetDataTypeInfo(NUdf::GetDataSlot(schemeType)).Name; -        TValuePackerType packer(false, PgmBuilder.NewOptionalType(PgmBuilder.NewDataType(schemeType))); +        TValuePackerType packer(false, PgmBuilder_.NewOptionalType(PgmBuilder_.NewDataType(schemeType)));          TestOptionalNumericValue<T>(std::optional<T>(Max<T>()), packer, typeDesc);          TestOptionalNumericValue<T>(std::optional<T>(Min<T>()), packer, typeDesc);          TestOptionalNumericValue<T>(std::optional<T>(), packer, typeDesc, 1); @@ -428,7 +428,7 @@ protected:      void TestStringType(NUdf::TDataTypeId schemeType) {          TString typeDesc = TStringBuilder() << ", Type:" << NUdf::GetDataTypeInfo(NUdf::GetDataSlot(schemeType)).Name; -        TValuePackerType packer(false, PgmBuilder.NewDataType(schemeType)); +        TValuePackerType packer(false, PgmBuilder_.NewDataType(schemeType));          TestStringValue("0123456789012345678901234567890123456789", packer, typeDesc, 40 + 4);          TestStringValue("[]", packer, typeDesc, Fast ? (2 + 4) : (2 + 1));          TestStringValue("1234567", packer, typeDesc, Fast ? (7 + 4) : (7 + 1)); @@ -442,7 +442,7 @@ protected:      void TestUuidType() {          auto schemeType = NUdf::TDataType<NUdf::TUuid>::Id;          TString typeDesc = TStringBuilder() << ", Type:" << NUdf::GetDataTypeInfo(NUdf::GetDataSlot(schemeType)).Name; -        TValuePackerType packer(false, PgmBuilder.NewDataType(schemeType)); +        TValuePackerType packer(false, PgmBuilder_.NewDataType(schemeType));          TestStringValue("0123456789abcdef", packer, typeDesc, Fast ? 16 : (16 + 4));      } @@ -459,7 +459,7 @@ protected:      void TestOptionalStringType(NUdf::TDataTypeId schemeType) {          TString typeDesc = TStringBuilder() << ", Type:Optional(" << NUdf::GetDataTypeInfo(NUdf::GetDataSlot(schemeType)).Name; -        TValuePackerType packer(false, PgmBuilder.NewOptionalType(PgmBuilder.NewDataType(schemeType))); +        TValuePackerType packer(false, PgmBuilder_.NewOptionalType(PgmBuilder_.NewDataType(schemeType)));          TestOptionalStringValue("0123456789012345678901234567890123456789", packer, typeDesc, Fast ? (40 + 4 + 1) : (40 + 4));          TestOptionalStringValue(std::nullopt, packer, typeDesc, 1);          TestOptionalStringValue("[]", packer, typeDesc, Fast ? (2 + 4 + 1) : (2 + 1)); @@ -472,7 +472,7 @@ protected:          TString descr = TStringBuilder() << "Type:Variant("              << static_cast<TVariantType*>(variantType)->GetUnderlyingType()->GetKindAsStr() << ')';          { -            const NUdf::TUnboxedValue value = HolderFactory.CreateVariantHolder(MakeString("01234567890123456789"), 0); +            const NUdf::TUnboxedValue value = HolderFactory_.CreateVariantHolder(MakeString("01234567890123456789"), 0);              const auto uValue = TestPackUnpack(variantType, value, descr);              UNIT_ASSERT_VALUES_EQUAL(uValue.GetVariantIndex(), 0); @@ -480,7 +480,7 @@ protected:              UNIT_ASSERT_VALUES_EQUAL(std::string_view(e.AsStringRef()), "01234567890123456789");          }          { -            const NUdf::TUnboxedValue value = HolderFactory.CreateVariantHolder(NUdf::TUnboxedValuePod(), 1); +            const NUdf::TUnboxedValue value = HolderFactory_.CreateVariantHolder(NUdf::TUnboxedValuePod(), 1);              const auto uValue = TestPackUnpack(variantType, value, descr);              UNIT_ASSERT_VALUES_EQUAL(uValue.GetVariantIndex(), 1); @@ -488,7 +488,7 @@ protected:              UNIT_ASSERT(!e);          }          { -            const NUdf::TUnboxedValue value = HolderFactory.CreateVariantHolder(NUdf::TUnboxedValuePod(ui64(12345)), 2); +            const NUdf::TUnboxedValue value = HolderFactory_.CreateVariantHolder(NUdf::TUnboxedValuePod(ui64(12345)), 2);              const auto uValue = TestPackUnpack(variantType, value, descr);              UNIT_ASSERT_VALUES_EQUAL(uValue.GetVariantIndex(), 2); @@ -499,19 +499,19 @@ protected:      NUdf::TUnboxedValue MakeTupleValue(TType*& tupleType, bool forPerf = false) {          std::vector<TType*> tupleElemenTypes; -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[0])); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[0])); -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id)); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[3])); -        tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(tupleElemenTypes[3])); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id)); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[0])); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[0])); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id)); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[3])); +        tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(tupleElemenTypes[3]));          if (!forPerf) { -            tupleElemenTypes.push_back(PgmBuilder.NewDecimalType(16, 8)); -            tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(PgmBuilder.NewDecimalType(22, 3))); -            tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(PgmBuilder.NewDecimalType(35, 2))); -            tupleElemenTypes.push_back(PgmBuilder.NewOptionalType(PgmBuilder.NewDecimalType(29, 0))); +            tupleElemenTypes.push_back(PgmBuilder_.NewDecimalType(16, 8)); +            tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(PgmBuilder_.NewDecimalType(22, 3))); +            tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(PgmBuilder_.NewDecimalType(35, 2))); +            tupleElemenTypes.push_back(PgmBuilder_.NewOptionalType(PgmBuilder_.NewDecimalType(29, 0)));          } -        tupleType = PgmBuilder.NewTupleType(tupleElemenTypes); +        tupleType = PgmBuilder_.NewTupleType(tupleElemenTypes);          auto inf = NYql::NDecimal::FromString("inf", 16, 8);          auto dec1 = NYql::NDecimal::FromString("12345.673", 22, 3); @@ -531,7 +531,7 @@ protected:              tupleElemens.push_back(NUdf::TUnboxedValuePod());          } -        return HolderFactory.VectorAsArray(tupleElemens); +        return HolderFactory_.VectorAsArray(tupleElemens);      }      void ValidateTupleValue(const NUdf::TUnboxedValue& value, bool forPerf = false) { @@ -562,27 +562,27 @@ protected:      void TestPairPackPerformance() {          std::vector<TType*> tupleElemenTypes; -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<ui32>::Id)); -        tupleElemenTypes.push_back(PgmBuilder.NewDataType(NUdf::TDataType<ui32>::Id)); -        TType* tupleType = PgmBuilder.NewTupleType(tupleElemenTypes); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<ui32>::Id)); +        tupleElemenTypes.push_back(PgmBuilder_.NewDataType(NUdf::TDataType<ui32>::Id)); +        TType* tupleType = PgmBuilder_.NewTupleType(tupleElemenTypes);          TUnboxedValueVector tupleElemens;          tupleElemens.push_back(NUdf::TUnboxedValuePod(ui32(12345)));          tupleElemens.push_back(NUdf::TUnboxedValuePod(ui32(67890))); -        const NUdf::TUnboxedValue value = HolderFactory.VectorAsArray(tupleElemens); +        const NUdf::TUnboxedValue value = HolderFactory_.VectorAsArray(tupleElemens);          TestPackPerformance(tupleType, value);      }      void TestShortStringPackPerformance() {          const auto v = NUdf::TUnboxedValuePod::Embedded("01234"); -        TType* type = PgmBuilder.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id); +        TType* type = PgmBuilder_.NewDataType(NUdf::TDataType<NUdf::TUtf8>::Id);          TestPackPerformance(type, v);      }      void TestIntegerPackPerformance() {          const auto& v = NUdf::TUnboxedValuePod(ui64("123456789ULL")); -        TType* type = PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id); +        TType* type = PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id);          TestPackPerformance(type, v);      } @@ -616,15 +616,15 @@ protected:                  UNIT_ASSERT_VALUES_EQUAL(result.Size(), packed.size());                  UNIT_ASSERT(result.Size() != result.ContigousSize()); -                ValidateTupleValue(packer.Unpack(std::move(result), HolderFactory)); +                ValidateTupleValue(packer.Unpack(std::move(result), HolderFactory_));              }          }      }      void TestIncrementalPacking() {          if constexpr (Transport) { -            auto itemType = PgmBuilder.NewDataType(NUdf::TDataType<char *>::Id); -            auto listType = PgmBuilder.NewListType(itemType); +            auto itemType = PgmBuilder_.NewDataType(NUdf::TDataType<char *>::Id); +            auto listType = PgmBuilder_.NewListType(itemType);              TValuePackerType packer(false, itemType);              TValuePackerType listPacker(false, listType); @@ -639,7 +639,7 @@ protected:              auto serialized = packer.Finish(); -            auto listObj = listPacker.Unpack(TChunkedBuffer(serialized), HolderFactory); +            auto listObj = listPacker.Unpack(TChunkedBuffer(serialized), HolderFactory_);              UNIT_ASSERT_VALUES_EQUAL(listObj.GetListLength(), count);              const auto iter = listObj.GetListIterator();              for (NUdf::TUnboxedValue uVal; iter.Next(uVal);) { @@ -648,7 +648,7 @@ protected:              }              TUnboxedValueBatch items; -            packer.UnpackBatch(std::move(serialized), HolderFactory, items); +            packer.UnpackBatch(std::move(serialized), HolderFactory_, items);              UNIT_ASSERT_VALUES_EQUAL(items.RowCount(), count);              items.ForEachRow([&](const NUdf::TUnboxedValue& value) {                  UNIT_ASSERT(value); @@ -685,24 +685,24 @@ protected:      class TArgsDispatcher : public IArgsDispatcher {      public:          TArgsDispatcher(TValue& dst, const std::vector<TValue>& choices) -            : Dst(dst) -            , Choices(choices) +            : Dst_(dst) +            , Choices_(choices)          {              UNIT_ASSERT_C(!choices.empty(), "Choices should not be empty");          }          ui64 GetSize() const { -            return Choices.size(); +            return Choices_.size();          }          void Set(ui64 index) { -            UNIT_ASSERT_LE_C(index + 1, Choices.size(), "Invalid args dispatcher index"); -            Dst = Choices[index]; +            UNIT_ASSERT_LE_C(index + 1, Choices_.size(), "Invalid args dispatcher index"); +            Dst_ = Choices_[index];          }      private: -        TValue& Dst; -        const std::vector<TValue> Choices; +        TValue& Dst_; +        const std::vector<TValue> Choices_;      };      void DoTestBlockPacking(const TBlockTestArgs& args) { @@ -710,29 +710,29 @@ protected:          ui64 offset = args.Offset;          ui64 len = args.Len;          if constexpr (Transport) { -            auto strType = PgmBuilder.NewDataType(NUdf::TDataType<char*>::Id); -            auto ui32Type = PgmBuilder.NewDataType(NUdf::TDataType<ui32>::Id); -            auto ui64Type = PgmBuilder.NewDataType(NUdf::TDataType<ui64>::Id); -            auto optStrType = PgmBuilder.NewOptionalType(strType); -            auto optUi32Type = PgmBuilder.NewOptionalType(ui32Type); - -            auto tupleOptUi32StrType = PgmBuilder.NewTupleType({ optUi32Type, strType }); -            auto optTupleOptUi32StrType = PgmBuilder.NewOptionalType(tupleOptUi32StrType); - -            auto blockUi32Type = PgmBuilder.NewBlockType(ui32Type, TBlockType::EShape::Many); -            auto blockOptStrType = PgmBuilder.NewBlockType(optStrType, TBlockType::EShape::Many); -            auto scalarOptStrType = PgmBuilder.NewBlockType(optStrType, TBlockType::EShape::Scalar); -            auto blockOptTupleOptUi32StrType = PgmBuilder.NewBlockType(optTupleOptUi32StrType, TBlockType::EShape::Many); -            auto scalarUi64Type = PgmBuilder.NewBlockType(ui64Type, TBlockType::EShape::Scalar); - -            auto tzDateType = PgmBuilder.NewDataType(NUdf::EDataSlot::TzDate); -            auto blockTzDateType = PgmBuilder.NewBlockType(tzDateType, TBlockType::EShape::Many); -            auto nullType = PgmBuilder.NewNullType(); -            auto blockNullType = PgmBuilder.NewBlockType(nullType, TBlockType::EShape::Many); +            auto strType = PgmBuilder_.NewDataType(NUdf::TDataType<char*>::Id); +            auto ui32Type = PgmBuilder_.NewDataType(NUdf::TDataType<ui32>::Id); +            auto ui64Type = PgmBuilder_.NewDataType(NUdf::TDataType<ui64>::Id); +            auto optStrType = PgmBuilder_.NewOptionalType(strType); +            auto optUi32Type = PgmBuilder_.NewOptionalType(ui32Type); + +            auto tupleOptUi32StrType = PgmBuilder_.NewTupleType({ optUi32Type, strType }); +            auto optTupleOptUi32StrType = PgmBuilder_.NewOptionalType(tupleOptUi32StrType); + +            auto blockUi32Type = PgmBuilder_.NewBlockType(ui32Type, TBlockType::EShape::Many); +            auto blockOptStrType = PgmBuilder_.NewBlockType(optStrType, TBlockType::EShape::Many); +            auto scalarOptStrType = PgmBuilder_.NewBlockType(optStrType, TBlockType::EShape::Scalar); +            auto blockOptTupleOptUi32StrType = PgmBuilder_.NewBlockType(optTupleOptUi32StrType, TBlockType::EShape::Many); +            auto scalarUi64Type = PgmBuilder_.NewBlockType(ui64Type, TBlockType::EShape::Scalar); + +            auto tzDateType = PgmBuilder_.NewDataType(NUdf::EDataSlot::TzDate); +            auto blockTzDateType = PgmBuilder_.NewBlockType(tzDateType, TBlockType::EShape::Many); +            auto nullType = PgmBuilder_.NewNullType(); +            auto blockNullType = PgmBuilder_.NewBlockType(nullType, TBlockType::EShape::Many);              auto rowType =                  legacyStruct -                    ? PgmBuilder.NewStructType({ +                    ? PgmBuilder_.NewStructType({                            {"A", blockUi32Type},                            {"B", blockOptStrType},                            {"_yql_block_length", scalarUi64Type}, @@ -741,7 +741,7 @@ protected:                            {"c", blockTzDateType},                            {"nill", blockNullType},                        }) -                    : PgmBuilder.NewMultiType( +                    : PgmBuilder_.NewMultiType(                            {blockUi32Type, blockOptStrType, scalarOptStrType,                             blockOptTupleOptUi32StrType, blockTzDateType, blockNullType, scalarUi64Type}); @@ -820,13 +820,13 @@ protected:              }              TUnboxedValueVector columns;              for (auto& datum : datums) { -                columns.emplace_back(HolderFactory.CreateArrowBlock(std::move(datum))); +                columns.emplace_back(HolderFactory_.CreateArrowBlock(std::move(datum)));              }              TValuePackerType packer(false, rowType, {}, ArrowPool_, args.MinFillPercentage);              if (legacyStruct) {                  TUnboxedValueVector columnsCopy = columns; -                NUdf::TUnboxedValue row = HolderFactory.VectorAsArray(columnsCopy); +                NUdf::TUnboxedValue row = HolderFactory_.VectorAsArray(columnsCopy);                  packer.AddItem(row);              } else {                  packer.AddWideItem(columns.data(), columns.size()); @@ -834,7 +834,7 @@ protected:              TChunkedBuffer packed = packer.Finish();              TUnboxedValueBatch unpacked(rowType); -            packer.UnpackBatch(std::move(packed), HolderFactory, unpacked); +            packer.UnpackBatch(std::move(packed), HolderFactory_, unpacked);              UNIT_ASSERT_VALUES_EQUAL(unpacked.RowCount(), 1); @@ -939,13 +939,13 @@ protected:      }  private: -    TIntrusivePtr<NMiniKQL::IFunctionRegistry> FunctionRegistry; -    TIntrusivePtr<IRandomProvider> RandomProvider; -    TScopedAlloc Alloc; -    TTypeEnvironment Env; -    TProgramBuilder PgmBuilder; -    TMemoryUsageInfo MemInfo; -    THolderFactory HolderFactory; +    TIntrusivePtr<NMiniKQL::IFunctionRegistry> FunctionRegistry_; +    TIntrusivePtr<IRandomProvider> RandomProvider_; +    TScopedAlloc Alloc_; +    TTypeEnvironment Env_; +    TProgramBuilder PgmBuilder_; +    TMemoryUsageInfo MemInfo_; +    THolderFactory HolderFactory_;      arrow::MemoryPool* const ArrowPool_;  }; diff --git a/yql/essentials/minikql/computation/mkql_computation_pattern_cache.cpp b/yql/essentials/minikql/computation/mkql_computation_pattern_cache.cpp index 49d34766317..fefeffa49e8 100644 --- a/yql/essentials/minikql/computation/mkql_computation_pattern_cache.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_pattern_cache.cpp @@ -11,31 +11,31 @@ public:          size_t maxPatternsSizeBytes,          size_t maxCompiledPatternsSize,          size_t maxCompiledPatternsSizeBytes) -        : MaxPatternsSize(maxPatternsSize) -        , MaxPatternsSizeBytes(maxPatternsSizeBytes) -        , MaxCompiledPatternsSize(maxCompiledPatternsSize) -        , MaxCompiledPatternsSizeBytes(maxCompiledPatternsSizeBytes) +        : MaxPatternsSize_(maxPatternsSize) +        , MaxPatternsSizeBytes_(maxPatternsSizeBytes) +        , MaxCompiledPatternsSize_(maxCompiledPatternsSize) +        , MaxCompiledPatternsSizeBytes_(maxCompiledPatternsSizeBytes)      {}      size_t PatternsSize() const { -        return SerializedProgramToPatternCacheHolder.size(); +        return SerializedProgramToPatternCacheHolder_.size();      }      size_t PatternsSizeInBytes() const { -        return CurrentPatternsSizeBytes; +        return CurrentPatternsSizeBytes_;      }      size_t CompiledPatternsSize() const { -        return CurrentCompiledPatternsSize; +        return CurrentCompiledPatternsSize_;      }      size_t PatternsCompiledCodeSizeInBytes() const { -        return CurrentPatternsCompiledCodeSizeInBytes; +        return CurrentPatternsCompiledCodeSizeInBytes_;      }      std::shared_ptr<TPatternCacheEntry> Find(const TString& serializedProgram) { -        auto it = SerializedProgramToPatternCacheHolder.find(serializedProgram); -        if (it == SerializedProgramToPatternCacheHolder.end()) { +        auto it = SerializedProgramToPatternCacheHolder_.find(serializedProgram); +        if (it == SerializedProgramToPatternCacheHolder_.end()) {              return {};          } @@ -45,7 +45,7 @@ public:      }      void Insert(const TString& serializedProgram, TPatternCacheEntryPtr entry) { -        auto [it, inserted] = SerializedProgramToPatternCacheHolder.emplace(std::piecewise_construct, +        auto [it, inserted] = SerializedProgramToPatternCacheHolder_.emplace(std::piecewise_construct,              std::forward_as_tuple(serializedProgram),              std::forward_as_tuple(serializedProgram, entry)); @@ -56,13 +56,13 @@ public:          }          /// New item is inserted, insert it in the back of both LRU lists and recalculate sizes -        CurrentPatternsSizeBytes += it->second.Entry->SizeForCache; -        LRUPatternList.PushBack(&it->second); +        CurrentPatternsSizeBytes_ += it->second.Entry->SizeForCache; +        LruPatternList_.PushBack(&it->second);          if (it->second.Entry->Pattern->IsCompiled()) { -            ++CurrentCompiledPatternsSize; -            CurrentPatternsCompiledCodeSizeInBytes += it->second.Entry->Pattern->CompiledCodeSize(); -            LRUCompiledPatternList.PushBack(&it->second); +            ++CurrentCompiledPatternsSize_; +            CurrentPatternsCompiledCodeSizeInBytes_ += it->second.Entry->Pattern->CompiledCodeSize(); +            LruCompiledPatternList_.PushBack(&it->second);          }          it->second.Entry->IsInCache.store(true); @@ -70,8 +70,8 @@ public:      }      void NotifyPatternCompiled(const TString& serializedProgram) { -        auto it = SerializedProgramToPatternCacheHolder.find(serializedProgram); -        if (it == SerializedProgramToPatternCacheHolder.end()) { +        auto it = SerializedProgramToPatternCacheHolder_.find(serializedProgram); +        if (it == SerializedProgramToPatternCacheHolder_.end()) {              return;          } @@ -90,25 +90,25 @@ public:          PromoteEntry(&it->second); -        ++CurrentCompiledPatternsSize; -        CurrentPatternsCompiledCodeSizeInBytes += entry->Pattern->CompiledCodeSize(); -        LRUCompiledPatternList.PushBack(&it->second); +        ++CurrentCompiledPatternsSize_; +        CurrentPatternsCompiledCodeSizeInBytes_ += entry->Pattern->CompiledCodeSize(); +        LruCompiledPatternList_.PushBack(&it->second);          ClearIfNeeded();      }      void Clear() { -        CurrentPatternsSizeBytes = 0; -        CurrentCompiledPatternsSize = 0; -        CurrentPatternsCompiledCodeSizeInBytes = 0; +        CurrentPatternsSizeBytes_ = 0; +        CurrentCompiledPatternsSize_ = 0; +        CurrentPatternsCompiledCodeSizeInBytes_ = 0; -        SerializedProgramToPatternCacheHolder.clear(); -        for (auto & holder : LRUPatternList) { +        SerializedProgramToPatternCacheHolder_.clear(); +        for (auto & holder : LruPatternList_) {              holder.Entry->IsInCache.store(false);          } -        LRUPatternList.Clear(); -        LRUCompiledPatternList.Clear(); +        LruPatternList_.Clear(); +        LruCompiledPatternList_.Clear();      }  private:      struct TPatternLRUListTag {}; @@ -137,96 +137,96 @@ private:      void PromoteEntry(TPatternCacheHolder* holder) {          Y_ASSERT(holder->LinkedInPatternLRUList()); -        LRUPatternList.Remove(holder); -        LRUPatternList.PushBack(holder); +        LruPatternList_.Remove(holder); +        LruPatternList_.PushBack(holder);          if (!holder->LinkedInCompiledPatternLRUList()) {              return;          } -        LRUCompiledPatternList.Remove(holder); -        LRUCompiledPatternList.PushBack(holder); +        LruCompiledPatternList_.Remove(holder); +        LruCompiledPatternList_.PushBack(holder);      }      void RemoveEntryFromLists(TPatternCacheHolder* holder) {          Y_ASSERT(holder->LinkedInPatternLRUList()); -        LRUPatternList.Remove(holder); +        LruPatternList_.Remove(holder); -        Y_ASSERT(holder->Entry->SizeForCache <= CurrentPatternsSizeBytes); -        CurrentPatternsSizeBytes -= holder->Entry->SizeForCache; +        Y_ASSERT(holder->Entry->SizeForCache <= CurrentPatternsSizeBytes_); +        CurrentPatternsSizeBytes_ -= holder->Entry->SizeForCache;          if (!holder->LinkedInCompiledPatternLRUList()) {              return;          } -        Y_ASSERT(CurrentCompiledPatternsSize > 0); -        --CurrentCompiledPatternsSize; +        Y_ASSERT(CurrentCompiledPatternsSize_ > 0); +        --CurrentCompiledPatternsSize_;          size_t patternCompiledCodeSize = holder->Entry->Pattern->CompiledCodeSize(); -        Y_ASSERT(patternCompiledCodeSize <= CurrentPatternsCompiledCodeSizeInBytes); -        CurrentPatternsCompiledCodeSizeInBytes -= patternCompiledCodeSize; +        Y_ASSERT(patternCompiledCodeSize <= CurrentPatternsCompiledCodeSizeInBytes_); +        CurrentPatternsCompiledCodeSizeInBytes_ -= patternCompiledCodeSize; -        LRUCompiledPatternList.Remove(holder); +        LruCompiledPatternList_.Remove(holder);          holder->Entry->IsInCache.store(false);      }      void ClearIfNeeded() {          /// Remove from pattern LRU list and compiled pattern LRU list -        while (SerializedProgramToPatternCacheHolder.size() > MaxPatternsSize || CurrentPatternsSizeBytes > MaxPatternsSizeBytes) { -            TPatternCacheHolder* holder = LRUPatternList.Front(); +        while (SerializedProgramToPatternCacheHolder_.size() > MaxPatternsSize_ || CurrentPatternsSizeBytes_ > MaxPatternsSizeBytes_) { +            TPatternCacheHolder* holder = LruPatternList_.Front();              RemoveEntryFromLists(holder); -            SerializedProgramToPatternCacheHolder.erase(holder->SerializedProgram); +            SerializedProgramToPatternCacheHolder_.erase(holder->SerializedProgram);          }          /// Only remove from compiled pattern LRU list -        while (CurrentCompiledPatternsSize > MaxCompiledPatternsSize || CurrentPatternsCompiledCodeSizeInBytes > MaxCompiledPatternsSizeBytes) { -            TPatternCacheHolder* holder = LRUCompiledPatternList.PopFront(); +        while (CurrentCompiledPatternsSize_ > MaxCompiledPatternsSize_ || CurrentPatternsCompiledCodeSizeInBytes_ > MaxCompiledPatternsSizeBytes_) { +            TPatternCacheHolder* holder = LruCompiledPatternList_.PopFront(); -            Y_ASSERT(CurrentCompiledPatternsSize > 0); -            --CurrentCompiledPatternsSize; +            Y_ASSERT(CurrentCompiledPatternsSize_ > 0); +            --CurrentCompiledPatternsSize_;              auto & pattern = holder->Entry->Pattern;              size_t patternCompiledSize = pattern->CompiledCodeSize(); -            Y_ASSERT(patternCompiledSize <= CurrentPatternsCompiledCodeSizeInBytes); -            CurrentPatternsCompiledCodeSizeInBytes -= patternCompiledSize; +            Y_ASSERT(patternCompiledSize <= CurrentPatternsCompiledCodeSizeInBytes_); +            CurrentPatternsCompiledCodeSizeInBytes_ -= patternCompiledSize;              pattern->RemoveCompiledCode();              holder->Entry->AccessTimes.store(0);          }      } -    const size_t MaxPatternsSize; -    const size_t MaxPatternsSizeBytes; -    const size_t MaxCompiledPatternsSize; -    const size_t MaxCompiledPatternsSizeBytes; +    const size_t MaxPatternsSize_; +    const size_t MaxPatternsSizeBytes_; +    const size_t MaxCompiledPatternsSize_; +    const size_t MaxCompiledPatternsSizeBytes_; -    size_t CurrentPatternsSizeBytes = 0; -    size_t CurrentCompiledPatternsSize = 0; -    size_t CurrentPatternsCompiledCodeSizeInBytes = 0; +    size_t CurrentPatternsSizeBytes_ = 0; +    size_t CurrentCompiledPatternsSize_ = 0; +    size_t CurrentPatternsCompiledCodeSizeInBytes_ = 0; -    THashMap<TString, TPatternCacheHolder> SerializedProgramToPatternCacheHolder; -    TIntrusiveList<TPatternCacheHolder, TPatternLRUListTag> LRUPatternList; -    TIntrusiveList<TPatternCacheHolder, TCompiledPatternLRUListTag> LRUCompiledPatternList; +    THashMap<TString, TPatternCacheHolder> SerializedProgramToPatternCacheHolder_; +    TIntrusiveList<TPatternCacheHolder, TPatternLRUListTag> LruPatternList_; +    TIntrusiveList<TPatternCacheHolder, TCompiledPatternLRUListTag> LruCompiledPatternList_;  };  TComputationPatternLRUCache::TComputationPatternLRUCache(const TComputationPatternLRUCache::Config& configuration, NMonitoring::TDynamicCounterPtr counters) -    : Cache(std::make_unique<TLRUPatternCacheImpl>(CacheMaxElementsSize, configuration.MaxSizeBytes, CacheMaxElementsSize, configuration.MaxCompiledSizeBytes)) -    , Configuration(configuration) -    , Hits(counters->GetCounter("PatternCache/Hits", true)) -    , HitsCompiled(counters->GetCounter("PatternCache/HitsCompiled", true)) -    , Waits(counters->GetCounter("PatternCache/Waits", true)) -    , Misses(counters->GetCounter("PatternCache/Misses", true)) -    , NotSuitablePattern(counters->GetCounter("PatternCache/NotSuitablePattern", true)) -    , SizeItems(counters->GetCounter("PatternCache/SizeItems", false)) -    , SizeCompiledItems(counters->GetCounter("PatternCache/SizeCompiledItems", false)) -    , SizeBytes(counters->GetCounter("PatternCache/SizeBytes", false)) -    , SizeCompiledBytes(counters->GetCounter("PatternCache/SizeCompiledBytes", false)) -    , MaxSizeBytesCounter(counters->GetCounter("PatternCache/MaxSizeBytes", false)) -    , MaxCompiledSizeBytesCounter(counters->GetCounter("PatternCache/MaxCompiledSizeBytes", false)) +    : Cache_(std::make_unique<TLRUPatternCacheImpl>(CacheMaxElementsSize, configuration.MaxSizeBytes, CacheMaxElementsSize, configuration.MaxCompiledSizeBytes)) +    , Configuration_(configuration) +    , Hits_(counters->GetCounter("PatternCache/Hits", true)) +    , HitsCompiled_(counters->GetCounter("PatternCache/HitsCompiled", true)) +    , Waits_(counters->GetCounter("PatternCache/Waits", true)) +    , Misses_(counters->GetCounter("PatternCache/Misses", true)) +    , NotSuitablePattern_(counters->GetCounter("PatternCache/NotSuitablePattern", true)) +    , SizeItems_(counters->GetCounter("PatternCache/SizeItems", false)) +    , SizeCompiledItems_(counters->GetCounter("PatternCache/SizeCompiledItems", false)) +    , SizeBytes_(counters->GetCounter("PatternCache/SizeBytes", false)) +    , SizeCompiledBytes_(counters->GetCounter("PatternCache/SizeCompiledBytes", false)) +    , MaxSizeBytesCounter_(counters->GetCounter("PatternCache/MaxSizeBytes", false)) +    , MaxCompiledSizeBytesCounter_(counters->GetCounter("PatternCache/MaxCompiledSizeBytes", false))  { -    *MaxSizeBytesCounter = Configuration.MaxSizeBytes; -    *MaxCompiledSizeBytesCounter = Configuration.MaxCompiledSizeBytes; +    *MaxSizeBytesCounter_ = Configuration_.MaxSizeBytes; +    *MaxCompiledSizeBytesCounter_ = Configuration_.MaxCompiledSizeBytes;  }  TComputationPatternLRUCache::~TComputationPatternLRUCache() { @@ -234,36 +234,36 @@ TComputationPatternLRUCache::~TComputationPatternLRUCache() {  }  TPatternCacheEntryPtr TComputationPatternLRUCache::Find(const TString& serializedProgram) { -    std::lock_guard<std::mutex> lock(Mutex); -    if (auto it = Cache->Find(serializedProgram)) { -        ++*Hits; +    std::lock_guard<std::mutex> lock(Mutex_); +    if (auto it = Cache_->Find(serializedProgram)) { +        ++*Hits_;          if (it->Pattern->IsCompiled()) -            ++*HitsCompiled; +            ++*HitsCompiled_;          return it;      } -    ++*Misses; +    ++*Misses_;      return {};  }  TPatternCacheEntryFuture TComputationPatternLRUCache::FindOrSubscribe(const TString& serializedProgram) { -    std::lock_guard lock(Mutex); -    if (auto it = Cache->Find(serializedProgram)) { -        ++*Hits; +    std::lock_guard lock(Mutex_); +    if (auto it = Cache_->Find(serializedProgram)) { +        ++*Hits_;          AccessPattern(serializedProgram, it);          return NThreading::MakeFuture<TPatternCacheEntryPtr>(it);      } -    auto [notifyIt, isNew] = Notify.emplace(std::piecewise_construct, std::forward_as_tuple(serializedProgram), std::forward_as_tuple()); +    auto [notifyIt, isNew] = Notify_.emplace(std::piecewise_construct, std::forward_as_tuple(serializedProgram), std::forward_as_tuple());      if (isNew) { -        ++*Misses; +        ++*Misses_;          // First future is empty - so the subscriber can initiate the entry creation.          return {};      } -    ++*Waits; +    ++*Waits_;      auto promise = NThreading::NewPromise<TPatternCacheEntryPtr>();      auto& subscribers = notifyIt->second;      subscribers.push_back(promise); @@ -277,19 +277,19 @@ void TComputationPatternLRUCache::EmplacePattern(const TString& serializedProgra      TVector<NThreading::TPromise<TPatternCacheEntryPtr>> subscribers;      { -        std::lock_guard lock(Mutex); -        Cache->Insert(serializedProgram, patternWithEnv); +        std::lock_guard lock(Mutex_); +        Cache_->Insert(serializedProgram, patternWithEnv); -        auto notifyIt = Notify.find(serializedProgram); -        if (notifyIt != Notify.end()) { +        auto notifyIt = Notify_.find(serializedProgram); +        if (notifyIt != Notify_.end()) {              subscribers.swap(notifyIt->second); -            Notify.erase(notifyIt); +            Notify_.erase(notifyIt);          } -        *SizeItems = Cache->PatternsSize(); -        *SizeBytes = Cache->PatternsSizeInBytes(); -        *SizeCompiledItems = Cache->CompiledPatternsSize(); -        *SizeCompiledBytes = Cache->PatternsCompiledCodeSizeInBytes(); +        *SizeItems_ = Cache_->PatternsSize(); +        *SizeBytes_ = Cache_->PatternsSizeInBytes(); +        *SizeCompiledItems_ = Cache_->CompiledPatternsSize(); +        *SizeCompiledBytes_ = Cache_->PatternsCompiledCodeSizeInBytes();      }      for (auto& subscriber : subscribers) { @@ -298,19 +298,19 @@ void TComputationPatternLRUCache::EmplacePattern(const TString& serializedProgra  }  void TComputationPatternLRUCache::NotifyPatternCompiled(const TString& serializedProgram) { -    std::lock_guard lock(Mutex); -    Cache->NotifyPatternCompiled(serializedProgram); +    std::lock_guard lock(Mutex_); +    Cache_->NotifyPatternCompiled(serializedProgram);  }  void TComputationPatternLRUCache::NotifyPatternMissing(const TString& serializedProgram) {      TVector<NThreading::TPromise<std::shared_ptr<TPatternCacheEntry>>> subscribers;      { -        std::lock_guard lock(Mutex); +        std::lock_guard lock(Mutex_); -        auto notifyIt = Notify.find(serializedProgram); -        if (notifyIt != Notify.end()) { +        auto notifyIt = Notify_.find(serializedProgram); +        if (notifyIt != Notify_.end()) {              subscribers.swap(notifyIt->second); -            Notify.erase(notifyIt); +            Notify_.erase(notifyIt);          }      } @@ -321,28 +321,28 @@ void TComputationPatternLRUCache::NotifyPatternMissing(const TString& serialized  }  size_t TComputationPatternLRUCache::GetSize() const { -    std::lock_guard lock(Mutex); -    return Cache->PatternsSize(); +    std::lock_guard lock(Mutex_); +    return Cache_->PatternsSize();  }  void TComputationPatternLRUCache::CleanCache() { -    *SizeItems = 0; -    *SizeBytes = 0; -    *MaxSizeBytesCounter = 0; -    std::lock_guard lock(Mutex); -    PatternsToCompile.clear(); -    Cache->Clear(); +    *SizeItems_ = 0; +    *SizeBytes_ = 0; +    *MaxSizeBytesCounter_ = 0; +    std::lock_guard lock(Mutex_); +    PatternsToCompile_.clear(); +    Cache_->Clear();  }  void TComputationPatternLRUCache::AccessPattern(const TString& serializedProgram, TPatternCacheEntryPtr entry) { -    if (!Configuration.PatternAccessTimesBeforeTryToCompile || entry->Pattern->IsCompiled()) { +    if (!Configuration_.PatternAccessTimesBeforeTryToCompile || entry->Pattern->IsCompiled()) {          return;      }      size_t PatternAccessTimes = entry->AccessTimes.fetch_add(1) + 1; -    if (PatternAccessTimes == *Configuration.PatternAccessTimesBeforeTryToCompile || -        (*Configuration.PatternAccessTimesBeforeTryToCompile == 0 && PatternAccessTimes == 1)) { -        PatternsToCompile.emplace(serializedProgram, entry); +    if (PatternAccessTimes == *Configuration_.PatternAccessTimesBeforeTryToCompile || +        (*Configuration_.PatternAccessTimesBeforeTryToCompile == 0 && PatternAccessTimes == 1)) { +        PatternsToCompile_.emplace(serializedProgram, entry);      }  } diff --git a/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h b/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h index c6120f85c6b..433bb842f6e 100644 --- a/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h +++ b/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h @@ -105,31 +105,31 @@ public:      void CleanCache();      Config GetConfiguration() const { -        std::lock_guard lock(Mutex); -        return Configuration; +        std::lock_guard lock(Mutex_); +        return Configuration_;      }      size_t GetMaxSizeBytes() const { -        std::lock_guard lock(Mutex); -        return Configuration.MaxSizeBytes; +        std::lock_guard lock(Mutex_); +        return Configuration_.MaxSizeBytes;      }      i64 GetCacheHits() const { -        return *Hits; +        return *Hits_;      }      void IncNotSuitablePattern() { -        ++*NotSuitablePattern; +        ++*NotSuitablePattern_;      }      size_t GetPatternsToCompileSize() const { -        std::lock_guard lock(Mutex); -        return PatternsToCompile.size(); +        std::lock_guard lock(Mutex_); +        return PatternsToCompile_.size();      }      void GetPatternsToCompile(THashMap<TString, TPatternCacheEntryPtr> & result) { -        std::lock_guard lock(Mutex); -        result.swap(PatternsToCompile); +        std::lock_guard lock(Mutex_); +        result.swap(PatternsToCompile_);      }  private: @@ -139,24 +139,24 @@ private:      void AccessPattern(const TString& serializedProgram, TPatternCacheEntryPtr entry); -    mutable std::mutex Mutex; -    THashMap<TString, TVector<NThreading::TPromise<TPatternCacheEntryPtr>>> Notify; // protected by Mutex -    std::unique_ptr<TLRUPatternCacheImpl> Cache;                                    // protected by Mutex -    THashMap<TString, TPatternCacheEntryPtr> PatternsToCompile;                     // protected by Mutex - -    const Config Configuration; - -    NMonitoring::TDynamicCounters::TCounterPtr Hits; -    NMonitoring::TDynamicCounters::TCounterPtr HitsCompiled; -    NMonitoring::TDynamicCounters::TCounterPtr Waits; -    NMonitoring::TDynamicCounters::TCounterPtr Misses; -    NMonitoring::TDynamicCounters::TCounterPtr NotSuitablePattern; -    NMonitoring::TDynamicCounters::TCounterPtr SizeItems; -    NMonitoring::TDynamicCounters::TCounterPtr SizeCompiledItems; -    NMonitoring::TDynamicCounters::TCounterPtr SizeBytes; -    NMonitoring::TDynamicCounters::TCounterPtr SizeCompiledBytes; -    NMonitoring::TDynamicCounters::TCounterPtr MaxSizeBytesCounter; -    NMonitoring::TDynamicCounters::TCounterPtr MaxCompiledSizeBytesCounter; +    mutable std::mutex Mutex_; +    THashMap<TString, TVector<NThreading::TPromise<TPatternCacheEntryPtr>>> Notify_; // protected by Mutex +    std::unique_ptr<TLRUPatternCacheImpl> Cache_;                                    // protected by Mutex +    THashMap<TString, TPatternCacheEntryPtr> PatternsToCompile_;                     // protected by Mutex + +    const Config Configuration_; + +    NMonitoring::TDynamicCounters::TCounterPtr Hits_; +    NMonitoring::TDynamicCounters::TCounterPtr HitsCompiled_; +    NMonitoring::TDynamicCounters::TCounterPtr Waits_; +    NMonitoring::TDynamicCounters::TCounterPtr Misses_; +    NMonitoring::TDynamicCounters::TCounterPtr NotSuitablePattern_; +    NMonitoring::TDynamicCounters::TCounterPtr SizeItems_; +    NMonitoring::TDynamicCounters::TCounterPtr SizeCompiledItems_; +    NMonitoring::TDynamicCounters::TCounterPtr SizeBytes_; +    NMonitoring::TDynamicCounters::TCounterPtr SizeCompiledBytes_; +    NMonitoring::TDynamicCounters::TCounterPtr MaxSizeBytesCounter_; +    NMonitoring::TDynamicCounters::TCounterPtr MaxCompiledSizeBytesCounter_;  };  } // namespace NKikimr::NMiniKQL diff --git a/yql/essentials/minikql/computation/mkql_custom_list.cpp b/yql/essentials/minikql/computation/mkql_custom_list.cpp index 6f8d68013bc..26f4c8ca204 100644 --- a/yql/essentials/minikql/computation/mkql_custom_list.cpp +++ b/yql/essentials/minikql/computation/mkql_custom_list.cpp @@ -5,50 +5,50 @@ namespace NMiniKQL {  TForwardListValue::TForwardListValue(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& stream)      : TCustomListValue(memInfo) -    , Stream(std::move(stream)) +    , Stream_(std::move(stream))  { -    MKQL_ENSURE(Stream, "Empty stream."); +    MKQL_ENSURE(Stream_, "Empty stream.");  }  TForwardListValue::TIterator::TIterator(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& stream) -    : TComputationValue(memInfo), Stream(std::move(stream)) +    : TComputationValue(memInfo), Stream_(std::move(stream))  {}  bool TForwardListValue::TIterator::Next(NUdf::TUnboxedValue& value) { -    const auto status = Stream.Fetch(value); +    const auto status = Stream_.Fetch(value);      MKQL_ENSURE(status != NUdf::EFetchStatus::Yield, "Unexpected stream status.");      return status == NUdf::EFetchStatus::Ok;  }  NUdf::TUnboxedValue TForwardListValue::GetListIterator() const { -    MKQL_ENSURE(Stream, "Second pass for ForwardList"); -    return NUdf::TUnboxedValuePod(new TIterator(GetMemInfo(), std::move(Stream))); +    MKQL_ENSURE(Stream_, "Second pass for ForwardList"); +    return NUdf::TUnboxedValuePod(new TIterator(GetMemInfo(), std::move(Stream_)));  }  TExtendListValue::TExtendListValue(TMemoryUsageInfo* memInfo, TUnboxedValueVector&& lists)      : TCustomListValue(memInfo) -    , Lists(std::move(lists)) +    , Lists_(std::move(lists))  { -    MKQL_MEM_TAKE(memInfo, Lists.data(), Lists.capacity() * sizeof(NUdf::TUnboxedValue)); -    Y_ASSERT(!Lists.empty()); +    MKQL_MEM_TAKE(memInfo, Lists_.data(), Lists_.capacity() * sizeof(NUdf::TUnboxedValue)); +    Y_ASSERT(!Lists_.empty());  }  TExtendListValue::TIterator::TIterator(TMemoryUsageInfo* memInfo, TUnboxedValueVector&& iters)      : TComputationValue(memInfo) -    , Iters(std::move(iters)) -    , Index(0) +    , Iters_(std::move(iters)) +    , Index_(0)  { -    MKQL_MEM_TAKE(memInfo, Iters.data(), Iters.capacity() * sizeof(NUdf::TUnboxedValue)); +    MKQL_MEM_TAKE(memInfo, Iters_.data(), Iters_.capacity() * sizeof(NUdf::TUnboxedValue));  }  TExtendListValue::TIterator::~TIterator()  { -    MKQL_MEM_RETURN(GetMemInfo(), Iters.data(), Iters.capacity() * sizeof(NUdf::TUnboxedValue)); +    MKQL_MEM_RETURN(GetMemInfo(), Iters_.data(), Iters_.capacity() * sizeof(NUdf::TUnboxedValue));  }  bool TExtendListValue::TIterator::Next(NUdf::TUnboxedValue& value) { -    for (; Index < Iters.size(); ++Index) { -        if (Iters[Index].Next(value)) { +    for (; Index_ < Iters_.size(); ++Index_) { +        if (Iters_[Index_].Next(value)) {              return true;          }      } @@ -56,8 +56,8 @@ bool TExtendListValue::TIterator::Next(NUdf::TUnboxedValue& value) {  }  bool TExtendListValue::TIterator::Skip() { -    for (; Index < Iters.size(); ++Index) { -        if (Iters[Index].Skip()) { +    for (; Index_ < Iters_.size(); ++Index_) { +        if (Iters_[Index_].Skip()) {              return true;          }      } @@ -66,8 +66,8 @@ bool TExtendListValue::TIterator::Skip() {  NUdf::TUnboxedValue TExtendListValue::GetListIterator() const {      TUnboxedValueVector iters; -    iters.reserve(Lists.size()); -    for (const auto& list : Lists) { +    iters.reserve(Lists_.size()); +    for (const auto& list : Lists_) {          iters.emplace_back(list.GetListIterator());      } @@ -75,55 +75,55 @@ NUdf::TUnboxedValue TExtendListValue::GetListIterator() const {  }  TExtendListValue::~TExtendListValue() { -    MKQL_MEM_RETURN(GetMemInfo(), Lists.data(), Lists.capacity() * sizeof(NUdf::TUnboxedValue)); +    MKQL_MEM_RETURN(GetMemInfo(), Lists_.data(), Lists_.capacity() * sizeof(NUdf::TUnboxedValue));  }  ui64 TExtendListValue::GetListLength() const { -    if (!Length) { +    if (!Length_) {          ui64 length = 0ULL; -        for (const auto& list : Lists) { +        for (const auto& list : Lists_) {              ui64 partialLength = list.GetListLength();              length += partialLength;          } -        Length = length; +        Length_ = length;      } -    return *Length; +    return *Length_;  }  bool TExtendListValue::HasListItems() const  { -    if (!HasItems) { -        for (const auto& list : Lists) { +    if (!HasItems_) { +        for (const auto& list : Lists_) {              if (list.HasListItems()) { -                HasItems = true; +                HasItems_ = true;                  break;              }          } -        if (!HasItems) { -            HasItems = false; +        if (!HasItems_) { +            HasItems_ = false;          }      } -    return *HasItems; +    return *HasItems_;  }  TExtendStreamValue::TExtendStreamValue(TMemoryUsageInfo* memInfo, TUnboxedValueVector&& lists)      : TBase(memInfo) -    , Lists(std::move(lists)) +    , Lists_(std::move(lists))  { -    MKQL_MEM_TAKE(memInfo, Lists.data(), Lists.capacity() * sizeof(NUdf::TUnboxedValue)); -    Y_ASSERT(!Lists.empty()); +    MKQL_MEM_TAKE(memInfo, Lists_.data(), Lists_.capacity() * sizeof(NUdf::TUnboxedValue)); +    Y_ASSERT(!Lists_.empty());  }  TExtendStreamValue::~TExtendStreamValue() { -    MKQL_MEM_RETURN(GetMemInfo(), Lists.data(), Lists.capacity() * sizeof(NUdf::TUnboxedValue)); +    MKQL_MEM_RETURN(GetMemInfo(), Lists_.data(), Lists_.capacity() * sizeof(NUdf::TUnboxedValue));  }  NUdf::EFetchStatus TExtendStreamValue::Fetch(NUdf::TUnboxedValue& value)  { -    for (; Index < Lists.size(); ++Index) { -        const auto status = Lists[Index].Fetch(value); +    for (; Index_ < Lists_.size(); ++Index_) { +        const auto status = Lists_[Index_].Fetch(value);          if (status != NUdf::EFetchStatus::Finish) {              return status;          } diff --git a/yql/essentials/minikql/computation/mkql_custom_list.h b/yql/essentials/minikql/computation/mkql_custom_list.h index 0d36156efad..56060c0a832 100644 --- a/yql/essentials/minikql/computation/mkql_custom_list.h +++ b/yql/essentials/minikql/computation/mkql_custom_list.h @@ -9,25 +9,27 @@ class TCustomListValue : public TComputationValue<TCustomListValue> {  public:      TCustomListValue(TMemoryUsageInfo* memInfo)          : TComputationValue(memInfo) +        , Length(Length_) +        , HasItems(HasItems_)      {      }  private:      bool HasFastListLength() const override { -        return bool(Length); +        return bool(Length_);      }      ui64 GetListLength() const override { -        if (!Length) { -            ui64 length = Iterator ? 1ULL : 0ULL; -            for (const auto it = Iterator ? std::move(Iterator) : NUdf::TBoxedValueAccessor::GetListIterator(*this); it.Skip();) { +        if (!Length_) { +            ui64 length = Iterator_ ? 1ULL : 0ULL; +            for (const auto it = Iterator_ ? std::move(Iterator_) : NUdf::TBoxedValueAccessor::GetListIterator(*this); it.Skip();) {                  ++length;              } -            Length = length; +            Length_ = length;          } -        return *Length; +        return *Length_;      }      ui64 GetEstimatedListLength() const override { @@ -35,27 +37,31 @@ private:      }      bool HasListItems() const override { -        if (HasItems) { -            return *HasItems; +        if (HasItems_) { +            return *HasItems_;          } -        if (Length) { -            HasItems = (*Length != 0); -            return *HasItems; +        if (Length_) { +            HasItems_ = (*Length_ != 0); +            return *HasItems_;          }          auto iter = NUdf::TBoxedValueAccessor::GetListIterator(*this); -        HasItems = iter.Skip(); -        if (*HasItems) { -            Iterator = std::move(iter); +        HasItems_ = iter.Skip(); +        if (*HasItems_) { +            Iterator_ = std::move(iter);          } -        return *HasItems; +        return *HasItems_;      }  protected: -    mutable std::optional<ui64> Length; -    mutable std::optional<bool> HasItems; -    mutable NUdf::TUnboxedValue Iterator; +    mutable std::optional<ui64> Length_; +    mutable std::optional<bool> HasItems_; +    mutable NUdf::TUnboxedValue Iterator_; + +    //FIXME Remove +    std::optional<ui64>& Length; // NOLINT(readability-identifier-naming) +    std::optional<bool>& HasItems; // NOLINT(readability-identifier-naming)  };  class TForwardListValue : public TCustomListValue { @@ -67,7 +73,7 @@ public:      private:          bool Next(NUdf::TUnboxedValue& value) override; -        const NUdf::TUnboxedValue Stream; +        const NUdf::TUnboxedValue Stream_;      };      TForwardListValue(TMemoryUsageInfo* memInfo, NUdf::TUnboxedValue&& stream); @@ -75,7 +81,7 @@ public:  private:      NUdf::TUnboxedValue GetListIterator() const override; -    mutable NUdf::TUnboxedValue Stream; +    mutable NUdf::TUnboxedValue Stream_;  };  class TExtendListValue : public TCustomListValue { @@ -89,8 +95,8 @@ public:          bool Next(NUdf::TUnboxedValue& value) override;          bool Skip() override; -        const TUnboxedValueVector Iters; -        ui32 Index; +        const TUnboxedValueVector Iters_; +        ui32 Index_;      };      TExtendListValue(TMemoryUsageInfo* memInfo, TUnboxedValueVector&& lists); @@ -102,7 +108,7 @@ private:      ui64 GetListLength() const override;      bool HasListItems() const override; -    const TUnboxedValueVector Lists; +    const TUnboxedValueVector Lists_;  };  class TExtendStreamValue : public TComputationValue<TExtendStreamValue> { @@ -116,8 +122,8 @@ public:  private:      NUdf::EFetchStatus Fetch(NUdf::TUnboxedValue& value); -    const TUnboxedValueVector Lists; -    ui32 Index = 0; +    const TUnboxedValueVector Lists_; +    ui32 Index_ = 0;  };  } diff --git a/yql/essentials/minikql/computation/mkql_key_payload_value_lru_cache.h b/yql/essentials/minikql/computation/mkql_key_payload_value_lru_cache.h index e8f8eb7d159..152a6db90a8 100644 --- a/yql/essentials/minikql/computation/mkql_key_payload_value_lru_cache.h +++ b/yql/essentials/minikql/computation/mkql_key_payload_value_lru_cache.h @@ -32,41 +32,41 @@ class TUnboxedKeyValueLruCacheWithTtl {  public:      TUnboxedKeyValueLruCacheWithTtl(size_t maxSize, const NKikimr::NMiniKQL::TType* keyType) -        : MaxSize(maxSize) -        , KeyTypeHelper(keyType) -        , Map( +        : MaxSize_(maxSize) +        , KeyTypeHelper_(keyType) +        , Map_(              1000, -            KeyTypeHelper.GetValueHash(), -            KeyTypeHelper.GetValueEqual() +            KeyTypeHelper_.GetValueHash(), +            KeyTypeHelper_.GetValueEqual()          )      { -        Y_ABORT_UNLESS(MaxSize > 0); +        Y_ABORT_UNLESS(MaxSize_ > 0);      }      TUnboxedKeyValueLruCacheWithTtl(const TUnboxedKeyValueLruCacheWithTtl&) = delete; //to prevent unintentional copy of a large object      void Update(NUdf::TUnboxedValue&& key, NUdf::TUnboxedValue&& value, std::chrono::time_point<std::chrono::steady_clock>&& expiration) { -        if (auto it = Map.find(key); it != Map.end()) { +        if (auto it = Map_.find(key); it != Map_.end()) {              Touch(it->second);              auto& entry = *it->second;              entry.Value = std::move(value);              entry.Expiration = std::move(expiration);          } else { -            if (Map.size() == MaxSize) { +            if (Map_.size() == MaxSize_) {                  RemoveLeastRecentlyUsedEntry();              } -            UsageList.emplace_back(key, std::move(value), std::move(expiration)); -            Map.emplace_hint(it, std::move(key), --UsageList.end()); +            UsageList_.emplace_back(key, std::move(value), std::move(expiration)); +            Map_.emplace_hint(it, std::move(key), --UsageList_.end());          }      }      std::optional<NUdf::TUnboxedValue> Get(const NUdf::TUnboxedValue key, const std::chrono::time_point<std::chrono::steady_clock>& now) { -        if (auto it = Map.find(key); it != Map.end()) { +        if (auto it = Map_.find(key); it != Map_.end()) {              if (now < it->second->Expiration) {                  Touch(it->second);                  return it->second->Value;              } else { -                UsageList.erase(it->second); -                Map.erase(it); +                UsageList_.erase(it->second); +                Map_.erase(it);                  return std::nullopt;              }          } @@ -76,10 +76,10 @@ public:      // Perform garbage collection, single step, O(1) time.      // Must be called periodically      bool Tick(const std::chrono::time_point<std::chrono::steady_clock>& now) { -        if (UsageList.empty()) { +        if (UsageList_.empty()) {              return false;          } -        if (now < UsageList.front().Expiration) { +        if (now < UsageList_.front().Expiration) {              return false;          }          RemoveLeastRecentlyUsedEntry(); @@ -93,8 +93,8 @@ public:      }      size_t Size() const { -        Y_ABORT_UNLESS(Map.size() == UsageList.size()); -        return Map.size(); +        Y_ABORT_UNLESS(Map_.size() == UsageList_.size()); +        return Map_.size();      }  private:      struct TKeyTypeHelpers { @@ -105,23 +105,23 @@ private:      };      void Touch(TUsageList::iterator it) { -        UsageList.splice(UsageList.end(), UsageList, it); //move accessed element to the end of Usage list +        UsageList_.splice(UsageList_.end(), UsageList_, it); //move accessed element to the end of Usage list      }      void RemoveLeastRecentlyUsedEntry() { -        Map.erase(UsageList.front().Key); -        UsageList.pop_front(); +        Map_.erase(UsageList_.front().Key); +        UsageList_.pop_front();      }  private: -    const size_t MaxSize; -    TUsageList UsageList; -    const TKeyTypeContanerHelper<true, true, false> KeyTypeHelper; +    const size_t MaxSize_; +    TUsageList UsageList_; +    const TKeyTypeContanerHelper<true, true, false> KeyTypeHelper_;      std::unordered_map< -        NUdf::TUnboxedValue,  +        NUdf::TUnboxedValue,          TUsageList::iterator,          TValueHasher,          TValueEqual,          NKikimr::NMiniKQL::TMKQLAllocator<std::pair<const NUdf::TUnboxedValue, TUsageList::iterator>> -    > Map; +    > Map_;  }; diff --git a/yql/essentials/minikql/computation/mkql_optional_usage_mask.h b/yql/essentials/minikql/computation/mkql_optional_usage_mask.h index dab8bb257cb..335a2df8232 100644 --- a/yql/essentials/minikql/computation/mkql_optional_usage_mask.h +++ b/yql/essentials/minikql/computation/mkql_optional_usage_mask.h @@ -17,61 +17,61 @@ public:      TOptionalUsageMask() = default;      void Reset() { -        CountOfOptional = 0U; -        Mask.Clear(); +        CountOfOptional_ = 0U; +        Mask_.Clear();      }      void Reset(TChunkedInputBuffer& buf) {          Reset();          ui64 bytes = UnpackUInt64(buf);          if (bytes) { -            Mask.Reserve(bytes << 3ULL); -            buf.CopyTo(reinterpret_cast<char*>(const_cast<ui8*>(Mask.GetChunks())), bytes); +            Mask_.Reserve(bytes << 3ULL); +            buf.CopyTo(reinterpret_cast<char*>(const_cast<ui8*>(Mask_.GetChunks())), bytes);          }      }      void SetNextEmptyOptional(bool empty) {          if (empty) { -            Mask.Set(CountOfOptional); +            Mask_.Set(CountOfOptional_);          } -        ++CountOfOptional; +        ++CountOfOptional_;      }      bool IsNextEmptyOptional() { -        return Mask.Test(CountOfOptional++); +        return Mask_.Test(CountOfOptional_++);      }      bool IsEmptyMask() const { -        return Mask.Empty(); +        return Mask_.Empty();      }      size_t CalcSerializedSize() { -        if (!CountOfOptional || Mask.Empty()) { +        if (!CountOfOptional_ || Mask_.Empty()) {              return 1ULL; // One byte for size=0          } -        const size_t usedBits = Mask.ValueBitCount(); +        const size_t usedBits = Mask_.ValueBitCount();          const size_t usedBytes = (usedBits + 7ULL) >> 3ULL;          return GetPack64Length(usedBytes) + usedBytes;      }      template<typename TBuf>      void Serialize(TBuf& buf) const { -        if (!CountOfOptional || Mask.Empty()) { +        if (!CountOfOptional_ || Mask_.Empty()) {              return buf.Append(0);          } -        const size_t usedBits = Mask.ValueBitCount(); +        const size_t usedBits = Mask_.ValueBitCount();          const size_t usedBytes = (usedBits + 7ULL) >> 3ULL;          buf.Advance(MAX_PACKED64_SIZE);          // Note: usage of Pack64() is safe here - it won't overwrite useful data for small values of usedBytes          buf.EraseBack(MAX_PACKED64_SIZE - Pack64(usedBytes, buf.Pos() - MAX_PACKED64_SIZE)); -        buf.Append(reinterpret_cast<const char*>(Mask.GetChunks()), usedBytes); +        buf.Append(reinterpret_cast<const char*>(Mask_.GetChunks()), usedBytes);      }  private: -    ui32 CountOfOptional = 0U; -    TBitMapOps<TDynamicBitMapTraits<ui8>> Mask; +    ui32 CountOfOptional_ = 0U; +    TBitMapOps<TDynamicBitMapTraits<ui8>> Mask_;  };  } // NDetails diff --git a/yql/essentials/minikql/computation/mkql_validate.cpp b/yql/essentials/minikql/computation/mkql_validate.cpp index e7ae813f71e..d478852793a 100644 --- a/yql/essentials/minikql/computation/mkql_validate.cpp +++ b/yql/essentials/minikql/computation/mkql_validate.cpp @@ -20,32 +20,32 @@ struct TLazyVerifyListValue;  template<class TValidateErrorPolicy>  struct TLazyVerifyListIterator: public TBoxedValue {      TLazyVerifyListIterator(const TLazyVerifyListValue<TValidateErrorPolicy>& lazyList, ui64 index = 0) -        : LazyList(lazyList) -        , OrigIter(TBoxedValueAccessor::GetListIterator(*lazyList.Orig)) -        , Index(index) +        : LazyList_(lazyList) +        , OrigIter_(TBoxedValueAccessor::GetListIterator(*lazyList.Orig)) +        , Index_(index)      { -        if (!OrigIter) { -            TValidateErrorPolicy::Generate(TStringBuilder() << "TLazyVerifyListIterator constructor expect non empty result of GetListIterator" << VERIFY_DELIMITER << LazyList.Message); +        if (!OrigIter_) { +            TValidateErrorPolicy::Generate(TStringBuilder() << "TLazyVerifyListIterator constructor expect non empty result of GetListIterator" << VERIFY_DELIMITER << LazyList_.Message);          }      }  private: -    const TLazyVerifyListValue<TValidateErrorPolicy>& LazyList; -    TUnboxedValue OrigIter; -    ui64 Index; +    const TLazyVerifyListValue<TValidateErrorPolicy>& LazyList_; +    TUnboxedValue OrigIter_; +    ui64 Index_;      bool Next(NUdf::TUnboxedValue& item) final { -        ++Index; -        if (!OrigIter.Next(item)) +        ++Index_; +        if (!OrigIter_.Next(item))              return false; -        TType* itemType = LazyList.ListType->GetItemType(); -        item = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyList.ValueBuilder, itemType, std::move(item), -                TStringBuilder() << "LazyList[" << Index << "]" << VERIFY_DELIMITER << LazyList.Message); +        TType* itemType = LazyList_.ListType->GetItemType(); +        item = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyList_.ValueBuilder, itemType, std::move(item), +                TStringBuilder() << "LazyList[" << Index_ << "]" << VERIFY_DELIMITER << LazyList_.Message);          return true;      }      bool Skip() final { -        ++Index; -        return OrigIter.Skip(); +        ++Index_; +        return OrigIter_.Skip();      }  }; @@ -135,42 +135,42 @@ private:  template<class TValidateErrorPolicy, bool Keys>  struct TLazyVerifyDictIterator: public TBoxedValue {      TLazyVerifyDictIterator(const TLazyVerifyDictValue<TValidateErrorPolicy>& lazyDict, ui64 index = 0) -        : LazyDict(lazyDict) -        , OrigIter((Keys ? &TBoxedValueAccessor::GetKeysIterator : &TBoxedValueAccessor::GetDictIterator)(*LazyDict.Orig)) -        , Index(index) +        : LazyDict_(lazyDict) +        , OrigIter_((Keys ? &TBoxedValueAccessor::GetKeysIterator : &TBoxedValueAccessor::GetDictIterator)(*LazyDict_.Orig)) +        , Index_(index)      { -        if (!OrigIter) { -            TValidateErrorPolicy::Generate(TStringBuilder() << "TLazyVerifyDictIterator constructor expect non empty result of GetDictIterator" << VERIFY_DELIMITER << LazyDict.Message); +        if (!OrigIter_) { +            TValidateErrorPolicy::Generate(TStringBuilder() << "TLazyVerifyDictIterator constructor expect non empty result of GetDictIterator" << VERIFY_DELIMITER << LazyDict_.Message);          }      }  private: -    const TLazyVerifyDictValue<TValidateErrorPolicy>& LazyDict; -    TUnboxedValue OrigIter; -    ui64 Index; +    const TLazyVerifyDictValue<TValidateErrorPolicy>& LazyDict_; +    TUnboxedValue OrigIter_; +    ui64 Index_;      bool Skip() final { -        ++Index; -        return OrigIter.Skip(); +        ++Index_; +        return OrigIter_.Skip();      }      bool Next(NUdf::TUnboxedValue& key) final { -        ++Index; -        if (!OrigIter.Next(key)) +        ++Index_; +        if (!OrigIter_.Next(key))              return false; -        key = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyDict.ValueBuilder, LazyDict.KeyType, std::move(key), -                TStringBuilder() << "LazyDict[" << Index << "], validate key" << VERIFY_DELIMITER << LazyDict.Message); +        key = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyDict_.ValueBuilder, LazyDict_.KeyType, std::move(key), +                TStringBuilder() << "LazyDict[" << Index_ << "], validate key" << VERIFY_DELIMITER << LazyDict_.Message);          return true;      }      bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) final { -        ++Index; -        if (!OrigIter.NextPair(key, payload)) +        ++Index_; +        if (!OrigIter_.NextPair(key, payload))              return false; -        key = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyDict.ValueBuilder, LazyDict.KeyType, std::move(key), -                TStringBuilder() << "LazyDict[" << Index << "], validate key" << VERIFY_DELIMITER << LazyDict.Message); -        payload = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyDict.ValueBuilder, LazyDict.PayloadType, std::move(payload), -                TStringBuilder() << "LazyDict[" << Index << "], validate payload" << VERIFY_DELIMITER << LazyDict.Message); +        key = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyDict_.ValueBuilder, LazyDict_.KeyType, std::move(key), +                TStringBuilder() << "LazyDict[" << Index_ << "], validate key" << VERIFY_DELIMITER << LazyDict_.Message); +        payload = TValidate<TValidateErrorPolicy, TValidateModeLazy<TValidateErrorPolicy>>::Value(LazyDict_.ValueBuilder, LazyDict_.PayloadType, std::move(payload), +                TStringBuilder() << "LazyDict[" << Index_ << "], validate payload" << VERIFY_DELIMITER << LazyDict_.Message);          return true;      }  }; @@ -238,31 +238,31 @@ public:      WrapCallableValue(const TCallableType* callableType, TUnboxedValue&& callable, const TString& message);  private: -    const TCallableType *const CallableType; -    const TUnboxedValue Callable; -    const TString Message; +    const TCallableType *const CallableType_; +    const TUnboxedValue Callable_; +    const TString Message_;      TUnboxedValue Run(const IValueBuilder* valueBuilder, const TUnboxedValuePod* args) const final;  };  template<class TValidateErrorPolicy, class TValidateMode>  WrapCallableValue<TValidateErrorPolicy, TValidateMode>::WrapCallableValue(const TCallableType* callableType, TUnboxedValue&& callable, const TString& message) -    : CallableType(callableType) -    , Callable(std::move(callable)) -    , Message(message) +    : CallableType_(callableType) +    , Callable_(std::move(callable)) +    , Message_(message)  {  }  template<class TValidateErrorPolicy, class TValidateMode>  TUnboxedValue WrapCallableValue<TValidateErrorPolicy, TValidateMode>::Run(const IValueBuilder* valueBuilder, const TUnboxedValuePod* args) const { -    const ui32 argsCount = CallableType->GetArgumentsCount(); +    const ui32 argsCount = CallableType_->GetArgumentsCount();      TSmallVec<TUnboxedValue> wrapArgs(argsCount);      bool childWrapped = false;      for (ui32 indexArg = 0; indexArg < argsCount; ++indexArg) { -        const auto argType = CallableType->GetArgumentType(indexArg); -        wrapArgs[indexArg] = TValidate<TValidateErrorPolicy, TValidateMode>::Value(valueBuilder, argType, TUnboxedValuePod(args[indexArg]), TStringBuilder() << "CallableWrapper<" << CallableType->GetName() << ">.arg[" << indexArg << "]" << VERIFY_DELIMITER << Message, &childWrapped); +        const auto argType = CallableType_->GetArgumentType(indexArg); +        wrapArgs[indexArg] = TValidate<TValidateErrorPolicy, TValidateMode>::Value(valueBuilder, argType, TUnboxedValuePod(args[indexArg]), TStringBuilder() << "CallableWrapper<" << CallableType_->GetName() << ">.arg[" << indexArg << "]" << VERIFY_DELIMITER << Message_, &childWrapped);      } -    return TValidate<TValidateErrorPolicy, TValidateMode>::Value(valueBuilder, CallableType->GetReturnType(), Callable.Run(valueBuilder, childWrapped ? wrapArgs.data() : args), TStringBuilder() << "CallableWrapper<" << CallableType->GetName() << ">.result" << VERIFY_DELIMITER << Message); +    return TValidate<TValidateErrorPolicy, TValidateMode>::Value(valueBuilder, CallableType_->GetReturnType(), Callable_.Run(valueBuilder, childWrapped ? wrapArgs.data() : args), TStringBuilder() << "CallableWrapper<" << CallableType_->GetName() << ">.result" << VERIFY_DELIMITER << Message_);  }  } // anonymous namespace diff --git a/yql/essentials/minikql/computation/mkql_validate_ut.cpp b/yql/essentials/minikql/computation/mkql_validate_ut.cpp index b4e4d50670a..690fed7729d 100644 --- a/yql/essentials/minikql/computation/mkql_validate_ut.cpp +++ b/yql/essentials/minikql/computation/mkql_validate_ut.cpp @@ -47,19 +47,19 @@ namespace NUdf {      template<class TContainer>      struct TListRefIterator: public TBoxedValue {          TListRefIterator(const TContainer& listRef, ui32 holePos) -            : ListRef(listRef) -            , Index(-1) -            , HolePos(holePos) +            : ListRef_(listRef) +            , Index_(-1) +            , HolePos_(holePos)          {}      private: -        const TContainer& ListRef; -        ui32 Index; -        ui32 HolePos; +        const TContainer& ListRef_; +        ui32 Index_; +        ui32 HolePos_;          bool Next(NUdf::TUnboxedValue& value) final { -            if (++Index >= ListRef.size()) +            if (++Index_ >= ListRef_.size())                  return false; -            value = Index == HolePos ? NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(42)) : ToUnboxedValue(ListRef[Index]); +            value = Index_ == HolePos_ ? NUdf::TUnboxedValue(NUdf::TUnboxedValuePod(42)) : ToUnboxedValue(ListRef_[Index_]);              return true;          }      }; @@ -67,34 +67,34 @@ namespace NUdf {      template<class TContainer, ui32 TIndexDictBrokenHole = RAW_INDEX_NO_HOLE, bool TNoDictIndex = false>      struct TListRef: public NUdf::TBoxedValue {          TListRef(const TContainer& listRef, ui32 holePos = RAW_INDEX_NO_HOLE) -            : ListRef(listRef) -            , HolePos(holePos) +            : ListRef_(listRef) +            , HolePos_(holePos)          {}      private: -        const TContainer& ListRef; -        const NUdf::IValueBuilder* ValueBuilder; -        ui32 HolePos; +        const TContainer& ListRef_; +        const NUdf::IValueBuilder* ValueBuilder_; +        ui32 HolePos_;          bool HasFastListLength() const override {              return true;          }          ui64 GetListLength() const override { -            return ListRef.size(); +            return ListRef_.size();          }          ui64 GetEstimatedListLength() const override { -            return ListRef.size(); +            return ListRef_.size();          }          NUdf::TUnboxedValue GetListIterator() const override { -            return NUdf::TUnboxedValuePod(new TListRefIterator<TContainer>(ListRef, HolePos)); +            return NUdf::TUnboxedValuePod(new TListRefIterator<TContainer>(ListRef_, HolePos_));          }          NUdf::IBoxedValuePtr ToIndexDictImpl(const IValueBuilder& builder) const override {              return TNoDictIndex ? nullptr : builder.ToIndexDict(NUdf::TUnboxedValuePod( -                new TListRef<TContainer, TIndexDictBrokenHole, true>(ListRef, TIndexDictBrokenHole))).AsBoxed(); +                new TListRef<TContainer, TIndexDictBrokenHole, true>(ListRef_, TIndexDictBrokenHole))).AsBoxed();          }      }; @@ -206,70 +206,70 @@ namespace NImpl {      struct TBrokenSeqListIterator: public NUdf::TBoxedValue {          TBrokenSeqListIterator(ui32 size, ui32 holePos) -            : Size(size) -            , HolePos(holePos) -            , Index(-1) +            : Size_(size) +            , HolePos_(holePos) +            , Index_(-1)          {}      private: -        ui32 Size; -        ui32 HolePos; -        ui32 Index; +        ui32 Size_; +        ui32 HolePos_; +        ui32 Index_;          bool Skip() final { -            return ++Index < Size; +            return ++Index_ < Size_;          }          bool Next(NUdf::TUnboxedValue& value) final {              if (!Skip())                  return false; -            value = Index == HolePos ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(Index); +            value = Index_ == HolePos_ ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(Index_);              return true;          }      };      struct TBrokenSeqListBoxedValue: public NUdf::TBoxedValue {          TBrokenSeqListBoxedValue(ui32 size, ui32 holePos) -            : ListSize(size) -            , HolePos(holePos) +            : ListSize_(size) +            , HolePos_(holePos)          {}      private: -        ui32 ListSize; -        ui32 HolePos; +        ui32 ListSize_; +        ui32 HolePos_;          bool HasFastListLength() const override {              return true;          }          ui64 GetListLength() const override { -            return ListSize; +            return ListSize_;          }          ui64 GetEstimatedListLength() const override { -            return ListSize; +            return ListSize_;          }          NUdf::TUnboxedValue GetListIterator() const override { -            return NUdf::TUnboxedValuePod(new TBrokenSeqListIterator(ListSize, HolePos)); +            return NUdf::TUnboxedValuePod(new TBrokenSeqListIterator(ListSize_, HolePos_));          }      };      template<class TStructType>      struct TBrokenStructBoxedValue: public NUdf::TBoxedValue {          TBrokenStructBoxedValue(const TStructType& data, ui32 holePos = RAW_INDEX_NO_HOLE) -            : Struct(data) -            , HolePos(holePos) +            : Struct_(data) +            , HolePos_(holePos)          {}      private: -        const TStructType& Struct; -        ui32 HolePos; +        const TStructType& Struct_; +        ui32 HolePos_;          NUdf::TUnboxedValue GetElement(ui32 index) const override { -            if (index == HolePos) { +            if (index == HolePos_) {                  return NUdf::TUnboxedValuePod();              } -            return Struct.GetByIndex(TStructType::MetaBackIndexes[index]); +            return Struct_.GetByIndex(TStructType::MetaBackIndexes[index]);          }      }; @@ -288,23 +288,23 @@ namespace {      template<class TTupleType>      struct TBrokenTupleBoxedValue: public NUdf::TBoxedValue {          TBrokenTupleBoxedValue(const TTupleType& tuple, ui32 holePos) -            : Tuple(tuple) -            , HolePos(holePos) +            : Tuple_(tuple) +            , HolePos_(holePos)          {}      private: -        const TTupleType& Tuple; -        ui32 HolePos; +        const TTupleType& Tuple_; +        ui32 HolePos_;          NUdf::TUnboxedValue GetElement(ui32 index) const override { -            if (index == HolePos) { +            if (index == HolePos_) {                  return NUdf::TUnboxedValuePod();              }              switch (index) { -                case 0: return ToUnboxedValue(std::get<0>(Tuple)); -                case 1: return ToUnboxedValue(std::get<1>(Tuple)); -                case 2: return ToUnboxedValue(std::get<2>(Tuple)); -                case 3: return ToUnboxedValue(std::get<3>(Tuple)); +                case 0: return ToUnboxedValue(std::get<0>(Tuple_)); +                case 1: return ToUnboxedValue(std::get<1>(Tuple_)); +                case 2: return ToUnboxedValue(std::get<2>(Tuple_)); +                case 3: return ToUnboxedValue(std::get<3>(Tuple_));                  default: Y_ABORT("Unexpected");              }          } @@ -315,31 +315,31 @@ namespace {      template<class TKey, class TValue>      struct TBrokenDictIterator: public NUdf::TBoxedValue {          TBrokenDictIterator(const std::vector<std::pair<TKey, TValue>>& dictData, PosPair holePos) -            : DictData(dictData) -            , HolePos(holePos) -            , Index(-1) +            : DictData_(dictData) +            , HolePos_(holePos) +            , Index_(-1)          {}      private: -        const std::vector<std::pair<TKey, TValue>>& DictData; -        PosPair HolePos; -        ui32 Index; +        const std::vector<std::pair<TKey, TValue>>& DictData_; +        PosPair HolePos_; +        ui32 Index_;          bool Skip() final { -            return ++Index < DictData.size(); +            return ++Index_ < DictData_.size();          }          bool Next(NUdf::TUnboxedValue& key) final {              if (!Skip())                  return false; -            key = Index == HolePos.first ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(DictData[Index].first); +            key = Index_ == HolePos_.first ? NUdf::TUnboxedValuePod() : NUdf::TUnboxedValuePod(DictData_[Index_].first);              return true;          }          bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) final {              if (!Next(key))                  return false; -            payload = Index == HolePos.second ? NUdf::TUnboxedValue() : ToUnboxedValue(DictData[Index].second); +            payload = Index_ == HolePos_.second ? NUdf::TUnboxedValue() : ToUnboxedValue(DictData_[Index_].second);              return true;          }      }; @@ -348,33 +348,33 @@ namespace {      struct TBrokenDictBoxedValue: public NUdf::TBoxedValue {          TBrokenDictBoxedValue(const std::vector<std::pair<TKey, TValue>>& dictData,              PosPair holePos, NUdf::TUnboxedValue&& hole = NUdf::TUnboxedValuePod()) -            : DictData(dictData) -            , HolePos(holePos) -            , Hole(std::move(hole)) +            : DictData_(dictData) +            , HolePos_(holePos) +            , Hole_(std::move(hole))          {}      private: -        const std::vector<std::pair<TKey, TValue>> DictData; -        PosPair HolePos; -        NUdf::TUnboxedValue Hole; +        const std::vector<std::pair<TKey, TValue>> DictData_; +        PosPair HolePos_; +        NUdf::TUnboxedValue Hole_;          NUdf::TUnboxedValue GetKeysIterator() const override { -            return NUdf::TUnboxedValuePod(new TBrokenDictIterator<TKey, TValue>(DictData, HolePos)); +            return NUdf::TUnboxedValuePod(new TBrokenDictIterator<TKey, TValue>(DictData_, HolePos_));          }          NUdf::TUnboxedValue GetDictIterator() const override { -            return NUdf::TUnboxedValuePod(new TBrokenDictIterator<TKey, TValue>(DictData, HolePos)); +            return NUdf::TUnboxedValuePod(new TBrokenDictIterator<TKey, TValue>(DictData_, HolePos_));          }      };      struct TThrowerValue: public NUdf::TBoxedValue {          static long Count;          TThrowerValue(NUdf::IBoxedValuePtr&& owner = NUdf::IBoxedValuePtr()) -            : Owner(std::move(owner)) +            : Owner_(std::move(owner))          { ++Count; }          ~TThrowerValue() { --Count; }      private: -        const NUdf::IBoxedValuePtr Owner; +        const NUdf::IBoxedValuePtr Owner_;          bool Skip() override {              ythrow yexception() << "Throw"; @@ -571,7 +571,7 @@ namespace {      const ui32 DICT_DIGIT2PERSON_BROKEN_PERSON_INDEX = 1;      const ui32 DICT_DIGIT2PERSON_BROKEN_STRUCT_INDEX = 2; -    const std::vector<std::pair<ui32, NUdf::IBoxedValuePtr>> MAKE_DICT_DIGIT2PERSON_BROKEN() { +    const std::vector<std::pair<ui32, NUdf::IBoxedValuePtr>> MakeDictDigiT2PersonBroken() {          std::vector<std::pair<ui32, NUdf::IBoxedValuePtr>> DICT_DIGIT2PERSON_BROKEN = {              { 333, new TBrokenStructBoxedValue<NUdf::PersonStruct>(STRUCT_PERSON_HITHCOCK, RAW_INDEX_NO_HOLE) },              { 5, new TBrokenStructBoxedValue<NUdf::PersonStruct>(STRUCT_PERSON_JONNIE, DICT_DIGIT2PERSON_BROKEN_STRUCT_INDEX) }, @@ -583,7 +583,7 @@ namespace {      typedef NUdf::TDict<ui32,NUdf::PersonStruct> NUdfDictDigPerson; -    std::vector<std::pair<ui32, NUdf::IBoxedValuePtr>> MAKE_DICT_DIGIT2PERSON() { +    std::vector<std::pair<ui32, NUdf::IBoxedValuePtr>> MakeDictDigiT2Person() {          const std::vector<std::pair<ui32, NUdf::IBoxedValuePtr>> DICT_DIGIT2PERSON = {              { 333, new TBrokenStructBoxedValue<NUdf::PersonStruct>(STRUCT_PERSON_HITHCOCK, RAW_INDEX_NO_HOLE) },              { 5, new TBrokenStructBoxedValue<NUdf::PersonStruct>(STRUCT_PERSON_JONNIE, RAW_INDEX_NO_HOLE) }, @@ -597,7 +597,7 @@ namespace {          Y_UNUSED(args);          Y_UNUSED(valueBuilder);          NUdf::IBoxedValuePtr boxed(new TBrokenDictBoxedValue<ui32, NUdf::IBoxedValuePtr>( -            MAKE_DICT_DIGIT2PERSON(), std::make_pair(RAW_INDEX_NO_HOLE, RAW_INDEX_NO_HOLE))); +            MakeDictDigiT2Person(), std::make_pair(RAW_INDEX_NO_HOLE, RAW_INDEX_NO_HOLE)));          return NUdf::TUnboxedValuePod(std::move(boxed));      } @@ -605,7 +605,7 @@ namespace {          Y_UNUSED(args);          Y_UNUSED(valueBuilder);          NUdf::IBoxedValuePtr boxed(new TBrokenDictBoxedValue<ui32, NUdf::IBoxedValuePtr>( -            MAKE_DICT_DIGIT2PERSON_BROKEN(), std::make_pair(RAW_INDEX_NO_HOLE, RAW_INDEX_NO_HOLE))); +            MakeDictDigiT2PersonBroken(), std::make_pair(RAW_INDEX_NO_HOLE, RAW_INDEX_NO_HOLE)));          return NUdf::TUnboxedValuePod(std::move(boxed));      } @@ -1120,7 +1120,7 @@ Y_UNIT_TEST_SUITE(TMiniKQLValidateTest) {              auto dictIter = value.GetDictIterator();              NUdf::TUnboxedValue key, payload;              for (ui32 index = 0; dictIter.NextPair(key, payload); ++index) { -                UNIT_ASSERT_VALUES_EQUAL(key.Get<ui32>(), MAKE_DICT_DIGIT2PERSON()[index].first); +                UNIT_ASSERT_VALUES_EQUAL(key.Get<ui32>(), MakeDictDigiT2Person()[index].first);                  auto person = payload;                  auto firstName = person.GetElement(NUdf::PersonStruct::MetaIndexes[0]);                  UNIT_ASSERT_VALUES_EQUAL(TString(firstName.AsStringRef()), DICT_DIGIT2PERSON_BROKEN_CONTENT_BY_INDEX[index]->FirstName); @@ -1137,7 +1137,7 @@ Y_UNIT_TEST_SUITE(TMiniKQLValidateTest) {              auto dictIter = value.GetDictIterator();              NUdf::TUnboxedValue key, payload;              for (ui32 index = 0; index < DICT_DIGIT2PERSON_BROKEN_PERSON_INDEX && dictIter.NextPair(key, payload); ++index) { -                UNIT_ASSERT_VALUES_EQUAL(key.Get<ui32>(), MAKE_DICT_DIGIT2PERSON_BROKEN()[index].first); +                UNIT_ASSERT_VALUES_EQUAL(key.Get<ui32>(), MakeDictDigiT2PersonBroken()[index].first);                  auto person = payload;                  auto firstName = person.GetElement(NUdf::PersonStruct::MetaIndexes[0]);                  UNIT_ASSERT_VALUES_EQUAL(TString(firstName.AsStringRef()), DICT_DIGIT2PERSON_BROKEN_CONTENT_BY_INDEX[index]->FirstName); diff --git a/yql/essentials/minikql/computation/mkql_value_builder_ut.cpp b/yql/essentials/minikql/computation/mkql_value_builder_ut.cpp index 127c55bc9b2..a22800590ec 100644 --- a/yql/essentials/minikql/computation/mkql_value_builder_ut.cpp +++ b/yql/essentials/minikql/computation/mkql_value_builder_ut.cpp @@ -37,32 +37,32 @@ namespace {  class TMiniKQLValueBuilderTest: public TTestBase {  public:      TMiniKQLValueBuilderTest() -        : FunctionRegistry(CreateFunctionRegistry(CreateBuiltinRegistry())) -        , Alloc(__LOCATION__) -        , Env(Alloc) -        , MemInfo("Memory") -        , HolderFactory(Alloc.Ref(), MemInfo, FunctionRegistry.Get()) -        , Builder(HolderFactory, NUdf::EValidatePolicy::Exception) -        , TypeInfoHelper(new TTypeInfoHelper()) -        , FunctionTypeInfoBuilder(NYql::UnknownLangVersion, Env, TypeInfoHelper, "", nullptr, {}) +        : FunctionRegistry_(CreateFunctionRegistry(CreateBuiltinRegistry())) +        , Alloc_(__LOCATION__) +        , Env_(Alloc_) +        , MemInfo_("Memory") +        , HolderFactory_(Alloc_.Ref(), MemInfo_, FunctionRegistry_.Get()) +        , Builder_(HolderFactory_, NUdf::EValidatePolicy::Exception) +        , TypeInfoHelper_(new TTypeInfoHelper()) +        , FunctionTypeInfoBuilder_(NYql::UnknownLangVersion, Env_, TypeInfoHelper_, "", nullptr, {})      { -        BoolOid = NYql::NPg::LookupType("bool").TypeId; +        BoolOid_ = NYql::NPg::LookupType("bool").TypeId;      }      const IPgBuilder& GetPgBuilder() const { -        return Builder.GetPgBuilder(); +        return Builder_.GetPgBuilder();      }  private: -    TIntrusivePtr<NMiniKQL::IFunctionRegistry> FunctionRegistry; -    TScopedAlloc Alloc; -    TTypeEnvironment Env; -    TMemoryUsageInfo MemInfo; -    THolderFactory HolderFactory; -    TDefaultValueBuilder Builder; -    NUdf::ITypeInfoHelper::TPtr TypeInfoHelper; -    TFunctionTypeInfoBuilder FunctionTypeInfoBuilder; -    ui32 BoolOid = 0; +    TIntrusivePtr<NMiniKQL::IFunctionRegistry> FunctionRegistry_; +    TScopedAlloc Alloc_; +    TTypeEnvironment Env_; +    TMemoryUsageInfo MemInfo_; +    THolderFactory HolderFactory_; +    TDefaultValueBuilder Builder_; +    NUdf::ITypeInfoHelper::TPtr TypeInfoHelper_; +    TFunctionTypeInfoBuilder FunctionTypeInfoBuilder_; +    ui32 BoolOid_ = 0;      UNIT_TEST_SUITE(TMiniKQLValueBuilderTest);          UNIT_TEST(TestEmbeddedVariant); @@ -79,7 +79,7 @@ private:      void TestEmbeddedVariant() { -        const auto v = Builder.NewVariant(62, TUnboxedValuePod((ui64) 42)); +        const auto v = Builder_.NewVariant(62, TUnboxedValuePod((ui64) 42));          UNIT_ASSERT(v);          UNIT_ASSERT(!v.IsBoxed());          UNIT_ASSERT_VALUES_EQUAL(62, v.GetVariantIndex()); @@ -87,7 +87,7 @@ private:      }      void TestBoxedVariant() { -        const auto v = Builder.NewVariant(63, TUnboxedValuePod((ui64) 42)); +        const auto v = Builder_.NewVariant(63, TUnboxedValuePod((ui64) 42));          UNIT_ASSERT(v);          UNIT_ASSERT(v.IsBoxed());          UNIT_ASSERT_VALUES_EQUAL(63, v.GetVariantIndex()); @@ -95,137 +95,137 @@ private:      }      void TestSubstring() { -        const auto string = Builder.NewString("0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"); +        const auto string = Builder_.NewString("0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM");          UNIT_ASSERT(string); -        const auto zero = Builder.SubString(string, 7, 0); +        const auto zero = Builder_.SubString(string, 7, 0);          UNIT_ASSERT_VALUES_EQUAL(TStringBuf(""), TStringBuf(zero.AsStringRef())); -        const auto tail = Builder.SubString(string, 60, 8); +        const auto tail = Builder_.SubString(string, 60, 8);          UNIT_ASSERT_VALUES_EQUAL(TStringBuf("NM"), TStringBuf(tail.AsStringRef())); -        const auto small = Builder.SubString(string, 2, 14); +        const auto small = Builder_.SubString(string, 2, 14);          UNIT_ASSERT_VALUES_EQUAL(TStringBuf("23456789qwerty"), TStringBuf(small.AsStringRef())); -        const auto one = Builder.SubString(string, 3, 15); +        const auto one = Builder_.SubString(string, 3, 15);          UNIT_ASSERT_VALUES_EQUAL(TStringBuf("3456789qwertyui"), TStringBuf(one.AsStringRef()));          UNIT_ASSERT_VALUES_EQUAL(string.AsStringValue().Data(), one.AsStringValue().Data()); -        const auto two = Builder.SubString(string, 10, 30); +        const auto two = Builder_.SubString(string, 10, 30);          UNIT_ASSERT_VALUES_EQUAL(TStringBuf("qwertyuiopasdfghjklzxcvbnmQWER"), TStringBuf(two.AsStringRef()));          UNIT_ASSERT_VALUES_EQUAL(string.AsStringValue().Data(), two.AsStringValue().Data());      }      void TestPgValueFromErrors() { -        const TBindTerminator bind(&Builder); // to raise exception instead of abort +        const TBindTerminator bind(&Builder_); // to raise exception instead of abort          {              TStringValue error(""); -            auto r = GetPgBuilder().ValueFromText(BoolOid, "", error); +            auto r = GetPgBuilder().ValueFromText(BoolOid_, "", error);              UNIT_ASSERT(!r);              UNIT_ASSERT_STRING_CONTAINS(AsString(error), "ERROR:  invalid input syntax for type boolean: \"\"");          }          {              TStringValue error(""); -            auto r = GetPgBuilder().ValueFromText(BoolOid, "zzzz", error); +            auto r = GetPgBuilder().ValueFromText(BoolOid_, "zzzz", error);              UNIT_ASSERT(!r);              UNIT_ASSERT_STRING_CONTAINS(AsString(error), "ERROR:  invalid input syntax for type boolean: \"zzzz\"");          }          {              TStringValue error(""); -            auto r = GetPgBuilder().ValueFromBinary(BoolOid, "", error); +            auto r = GetPgBuilder().ValueFromBinary(BoolOid_, "", error);              UNIT_ASSERT(!r);              UNIT_ASSERT_STRING_CONTAINS(AsString(error), "ERROR:  no data left in message");          }          {              TStringValue error(""); -            auto r = GetPgBuilder().ValueFromBinary(BoolOid, "zzzz", error); +            auto r = GetPgBuilder().ValueFromBinary(BoolOid_, "zzzz", error);              UNIT_ASSERT(!r);              UNIT_ASSERT_STRING_CONTAINS(AsString(error), "Not all data has been consumed by 'recv' function: boolrecv, data size: 4, consumed size: 1");          }      }      void TestPgValueFromText() { -        const TBindTerminator bind(&Builder); +        const TBindTerminator bind(&Builder_);          for (auto validTrue : { "t"sv, "true"sv }) {              TStringValue error(""); -            auto r = GetPgBuilder().ValueFromText(BoolOid, validTrue, error); +            auto r = GetPgBuilder().ValueFromText(BoolOid_, validTrue, error);              UNIT_ASSERT(r);              UNIT_ASSERT_VALUES_EQUAL(AsString(error), ""); -            auto s = PgValueToNativeText(r, BoolOid); +            auto s = PgValueToNativeText(r, BoolOid_);              UNIT_ASSERT_VALUES_EQUAL(s, "t");          }          for (auto validFalse : { "f"sv, "false"sv }) {              TStringValue error(""); -            auto r = GetPgBuilder().ValueFromText(BoolOid, validFalse, error); +            auto r = GetPgBuilder().ValueFromText(BoolOid_, validFalse, error);              UNIT_ASSERT(r);              UNIT_ASSERT_VALUES_EQUAL(AsString(error), ""); -            auto s = PgValueToNativeText(r, BoolOid); +            auto s = PgValueToNativeText(r, BoolOid_);              UNIT_ASSERT_VALUES_EQUAL(s, "f");          }      }      void TestPgValueFromBinary() { -        const TBindTerminator bind(&Builder); +        const TBindTerminator bind(&Builder_);          TStringValue error(""); -        auto t = GetPgBuilder().ValueFromText(BoolOid, "true", error); +        auto t = GetPgBuilder().ValueFromText(BoolOid_, "true", error);          UNIT_ASSERT(t); -        auto f = GetPgBuilder().ValueFromText(BoolOid, "false", error); +        auto f = GetPgBuilder().ValueFromText(BoolOid_, "false", error);          UNIT_ASSERT(f); -        auto ts = PgValueToNativeBinary(t, BoolOid); -        auto fs = PgValueToNativeBinary(f, BoolOid); +        auto ts = PgValueToNativeBinary(t, BoolOid_); +        auto fs = PgValueToNativeBinary(f, BoolOid_);          { -            auto r = GetPgBuilder().ValueFromBinary(BoolOid, ts, error); +            auto r = GetPgBuilder().ValueFromBinary(BoolOid_, ts, error);              UNIT_ASSERT(r); -            auto s = PgValueToNativeText(r, BoolOid); +            auto s = PgValueToNativeText(r, BoolOid_);              UNIT_ASSERT_VALUES_EQUAL(s, "t");          }          { -            auto r = GetPgBuilder().ValueFromBinary(BoolOid, fs, error); +            auto r = GetPgBuilder().ValueFromBinary(BoolOid_, fs, error);              UNIT_ASSERT(r); -            auto s = PgValueToNativeText(r, BoolOid); +            auto s = PgValueToNativeText(r, BoolOid_);              UNIT_ASSERT_VALUES_EQUAL(s, "f");          }      }      void TestConvertToFromPg() { -        const TBindTerminator bind(&Builder); -        auto boolType = FunctionTypeInfoBuilder.SimpleType<bool>(); +        const TBindTerminator bind(&Builder_); +        auto boolType = FunctionTypeInfoBuilder_.SimpleType<bool>();          { -            auto v = GetPgBuilder().ConvertToPg(TUnboxedValuePod(true), boolType, BoolOid); -            auto s = PgValueToNativeText(v, BoolOid); +            auto v = GetPgBuilder().ConvertToPg(TUnboxedValuePod(true), boolType, BoolOid_); +            auto s = PgValueToNativeText(v, BoolOid_);              UNIT_ASSERT_VALUES_EQUAL(s, "t"); -            auto from = GetPgBuilder().ConvertFromPg(v, BoolOid, boolType); +            auto from = GetPgBuilder().ConvertFromPg(v, BoolOid_, boolType);              UNIT_ASSERT_VALUES_EQUAL(from.Get<bool>(), true);          }          { -            auto v = GetPgBuilder().ConvertToPg(TUnboxedValuePod(false), boolType, BoolOid); -            auto s = PgValueToNativeText(v, BoolOid); +            auto v = GetPgBuilder().ConvertToPg(TUnboxedValuePod(false), boolType, BoolOid_); +            auto s = PgValueToNativeText(v, BoolOid_);              UNIT_ASSERT_VALUES_EQUAL(s, "f"); -            auto from = GetPgBuilder().ConvertFromPg(v, BoolOid, boolType); +            auto from = GetPgBuilder().ConvertFromPg(v, BoolOid_, boolType);              UNIT_ASSERT_VALUES_EQUAL(from.Get<bool>(), false);          }      }      void TestConvertToFromPgNulls() { -        const TBindTerminator bind(&Builder); -        auto boolOptionalType = FunctionTypeInfoBuilder.Optional()->Item<bool>().Build(); +        const TBindTerminator bind(&Builder_); +        auto boolOptionalType = FunctionTypeInfoBuilder_.Optional()->Item<bool>().Build();          { -            auto v = GetPgBuilder().ConvertToPg(TUnboxedValuePod(), boolOptionalType, BoolOid); +            auto v = GetPgBuilder().ConvertToPg(TUnboxedValuePod(), boolOptionalType, BoolOid_);              UNIT_ASSERT(!v);          }          { -            auto v = GetPgBuilder().ConvertFromPg(TUnboxedValuePod(), BoolOid, boolOptionalType); +            auto v = GetPgBuilder().ConvertFromPg(TUnboxedValuePod(), BoolOid_, boolOptionalType);              UNIT_ASSERT(!v);          }      } @@ -236,7 +236,7 @@ private:              UNIT_ASSERT_VALUES_EQUAL(pgText.TypeLen, -1);              auto s = GetPgBuilder().NewString(pgText.TypeLen, pgText.TypeId, "ABC"); -            auto utf8Type = FunctionTypeInfoBuilder.SimpleType<TUtf8>(); +            auto utf8Type = FunctionTypeInfoBuilder_.SimpleType<TUtf8>();              auto from = GetPgBuilder().ConvertFromPg(s, pgText.TypeId, utf8Type);              UNIT_ASSERT_VALUES_EQUAL((TStringBuf)from.AsStringRef(), "ABC"sv);          } @@ -246,7 +246,7 @@ private:              UNIT_ASSERT_VALUES_EQUAL(pgCString.TypeLen, -2);              auto s = GetPgBuilder().NewString(pgCString.TypeLen, pgCString.TypeId, "ABC"); -            auto utf8Type = FunctionTypeInfoBuilder.SimpleType<TUtf8>(); +            auto utf8Type = FunctionTypeInfoBuilder_.SimpleType<TUtf8>();              auto from = GetPgBuilder().ConvertFromPg(s, pgCString.TypeId, utf8Type);              UNIT_ASSERT_VALUES_EQUAL((TStringBuf)from.AsStringRef(), "ABC"sv);          } @@ -256,29 +256,29 @@ private:              UNIT_ASSERT_VALUES_EQUAL(byteaString.TypeLen, -1);              auto s = GetPgBuilder().NewString(byteaString.TypeLen, byteaString.TypeId, "ABC"); -            auto stringType = FunctionTypeInfoBuilder.SimpleType<char*>(); +            auto stringType = FunctionTypeInfoBuilder_.SimpleType<char*>();              auto from = GetPgBuilder().ConvertFromPg(s, byteaString.TypeId, stringType);              UNIT_ASSERT_VALUES_EQUAL((TStringBuf)from.AsStringRef(), "ABC"sv);          }      }      void TestArrowBlock() { -        auto type = FunctionTypeInfoBuilder.SimpleType<ui64>(); -        auto atype = TypeInfoHelper->MakeArrowType(type); +        auto type = FunctionTypeInfoBuilder_.SimpleType<ui64>(); +        auto atype = TypeInfoHelper_->MakeArrowType(type);          {              arrow::Datum d1(std::make_shared<arrow::UInt64Scalar>(123)); -            NUdf::TUnboxedValue val1 = HolderFactory.CreateArrowBlock(std::move(d1)); +            NUdf::TUnboxedValue val1 = HolderFactory_.CreateArrowBlock(std::move(d1));              bool isScalar;              ui64 length; -            auto chunks = Builder.GetArrowBlockChunks(val1, isScalar, length); +            auto chunks = Builder_.GetArrowBlockChunks(val1, isScalar, length);              UNIT_ASSERT_VALUES_EQUAL(chunks, 1);              UNIT_ASSERT(isScalar);              UNIT_ASSERT_VALUES_EQUAL(length, 1);              ArrowArray arr1; -            Builder.ExportArrowBlock(val1, 0, &arr1); -            NUdf::TUnboxedValue val2 = Builder.ImportArrowBlock(&arr1, 1, isScalar, *atype); +            Builder_.ExportArrowBlock(val1, 0, &arr1); +            NUdf::TUnboxedValue val2 = Builder_.ImportArrowBlock(&arr1, 1, isScalar, *atype);              const auto& d2 = TArrowBlock::From(val2).GetDatum();              UNIT_ASSERT(d2.is_scalar());              UNIT_ASSERT_VALUES_EQUAL(d2.scalar_as<arrow::UInt64Scalar>().value, 123); @@ -293,18 +293,18 @@ private:              std::shared_ptr<arrow::ArrayData> builderResult;              UNIT_ASSERT(builder.FinishInternal(&builderResult).ok());              arrow::Datum d1(builderResult); -            NUdf::TUnboxedValue val1 = HolderFactory.CreateArrowBlock(std::move(d1)); +            NUdf::TUnboxedValue val1 = HolderFactory_.CreateArrowBlock(std::move(d1));              bool isScalar;              ui64 length; -            auto chunks = Builder.GetArrowBlockChunks(val1, isScalar, length); +            auto chunks = Builder_.GetArrowBlockChunks(val1, isScalar, length);              UNIT_ASSERT_VALUES_EQUAL(chunks, 1);              UNIT_ASSERT(!isScalar);              UNIT_ASSERT_VALUES_EQUAL(length, 3);              ArrowArray arr1; -            Builder.ExportArrowBlock(val1, 0, &arr1); -            NUdf::TUnboxedValue val2 = Builder.ImportArrowBlock(&arr1, 1, isScalar, *atype); +            Builder_.ExportArrowBlock(val1, 0, &arr1); +            NUdf::TUnboxedValue val2 = Builder_.ImportArrowBlock(&arr1, 1, isScalar, *atype);              const auto& d2 = TArrowBlock::From(val2).GetDatum();              UNIT_ASSERT(d2.is_array());              UNIT_ASSERT_VALUES_EQUAL(d2.array()->length, 3); @@ -333,19 +333,19 @@ private:              auto chunked = arrow::ChunkedArray::Make({ builder1Result, builder2Result }).ValueOrDie();              arrow::Datum d1(chunked); -            NUdf::TUnboxedValue val1 = HolderFactory.CreateArrowBlock(std::move(d1)); +            NUdf::TUnboxedValue val1 = HolderFactory_.CreateArrowBlock(std::move(d1));              bool isScalar;              ui64 length; -            auto chunks = Builder.GetArrowBlockChunks(val1, isScalar, length); +            auto chunks = Builder_.GetArrowBlockChunks(val1, isScalar, length);              UNIT_ASSERT_VALUES_EQUAL(chunks, 2);              UNIT_ASSERT(!isScalar);              UNIT_ASSERT_VALUES_EQUAL(length, 5);              ArrowArray arrs[2]; -            Builder.ExportArrowBlock(val1, 0, &arrs[0]); -            Builder.ExportArrowBlock(val1, 1, &arrs[1]); -            NUdf::TUnboxedValue val2 = Builder.ImportArrowBlock(arrs, 2, isScalar, *atype); +            Builder_.ExportArrowBlock(val1, 0, &arrs[0]); +            Builder_.ExportArrowBlock(val1, 1, &arrs[1]); +            NUdf::TUnboxedValue val2 = Builder_.ImportArrowBlock(arrs, 2, isScalar, *atype);              const auto& d2 = TArrowBlock::From(val2).GetDatum();              UNIT_ASSERT(d2.is_arraylike() && !d2.is_array());              UNIT_ASSERT_VALUES_EQUAL(d2.length(), 5); diff --git a/yql/essentials/minikql/computation/mkql_vector_spiller_adapter.h b/yql/essentials/minikql/computation/mkql_vector_spiller_adapter.h index 8c9896cf98d..e39c29154fb 100644 --- a/yql/essentials/minikql/computation/mkql_vector_spiller_adapter.h +++ b/yql/essentials/minikql/computation/mkql_vector_spiller_adapter.h @@ -23,41 +23,41 @@ public:      };      TVectorSpillerAdapter(ISpiller::TPtr spiller, size_t sizeLimit) -        : Spiller(spiller) -        , SizeLimit(sizeLimit) +        : Spiller_(spiller) +        , SizeLimit_(sizeLimit)      {      }      ///Returns current stete of the adapter      EState GetState() const { -        return State; +        return State_;      }      ///Is adapter ready to spill next vector via AddData method.      ///Returns false in case when there are async operations in progress.      bool IsAcceptingData() { -        return State == EState::AcceptingData; +        return State_ == EState::AcceptingData;      }      ///When data is ready ExtractVector() is expected to be called.      bool IsDataReady() { -        return State == EState::DataReady; +        return State_ == EState::DataReady;      }      ///Adapter is ready to accept requests for vectors.      bool IsAcceptingDataRequests() { -        return State == EState::AcceptingDataRequests; +        return State_ == EState::AcceptingDataRequests;      }      ///Adds new vector to storage. Will not launch real disk operation if case of small vectors      ///(if inner buffer is not full).      void AddData(std::vector<T, Alloc>&& vec) { -        MKQL_ENSURE(CurrentVector.empty(), "Internal logic error"); -        MKQL_ENSURE(State == EState::AcceptingData, "Internal logic error"); +        MKQL_ENSURE(CurrentVector_.empty(), "Internal logic error"); +        MKQL_ENSURE(State_ == EState::AcceptingData, "Internal logic error"); -        StoredChunksElementsCount.push(vec.size()); -        CurrentVector = std::move(vec); -        NextVectorPositionToSave = 0; +        StoredChunksElementsCount_.push(vec.size()); +        CurrentVector_ = std::move(vec); +        NextVectorPositionToSave_ = 0;          SaveNextPartOfVector();      } @@ -66,31 +66,31 @@ public:      ///For SpillingData state it will try to spill more content of inner buffer.      ///ForRestoringData state it will try to load more content of requested vector.      void Update() { -        switch (State) { +        switch (State_) {              case EState::SpillingData: -                MKQL_ENSURE(WriteOperation.has_value(), "Internal logic error"); -                if (!WriteOperation->HasValue()) return; +                MKQL_ENSURE(WriteOperation_.has_value(), "Internal logic error"); +                if (!WriteOperation_->HasValue()) return; -                StoredChunks.push(WriteOperation->ExtractValue()); -                WriteOperation = std::nullopt; -                if (IsFinalizing) { -                    State = EState::AcceptingDataRequests; +                StoredChunks_.push(WriteOperation_->ExtractValue()); +                WriteOperation_ = std::nullopt; +                if (IsFinalizing_) { +                    State_ = EState::AcceptingDataRequests;                      return;                  } -                if (CurrentVector.empty()) { -                    State = EState::AcceptingData; +                if (CurrentVector_.empty()) { +                    State_ = EState::AcceptingData;                      return;                  }                  SaveNextPartOfVector();                  return;              case EState::RestoringData: -                MKQL_ENSURE(ReadOperation.has_value(), "Internal logic error"); -                if (!ReadOperation->HasValue()) return; -                Buffer = std::move(ReadOperation->ExtractValue().value()); -                ReadOperation = std::nullopt; -                StoredChunks.pop(); +                MKQL_ENSURE(ReadOperation_.has_value(), "Internal logic error"); +                if (!ReadOperation_->HasValue()) return; +                Buffer_ = std::move(ReadOperation_->ExtractValue().value()); +                ReadOperation_ = std::nullopt; +                StoredChunks_.pop();                  LoadNextVector();                  return; @@ -101,21 +101,21 @@ public:      ///Get requested vector.      std::vector<T, Alloc>&& ExtractVector() { -        StoredChunksElementsCount.pop(); -        State = EState::AcceptingDataRequests; -        return std::move(CurrentVector); +        StoredChunksElementsCount_.pop(); +        State_ = EState::AcceptingDataRequests; +        return std::move(CurrentVector_);      }      ///Start restoring next vector. If th eentire contents of the vector are in memory      ///State will be changed to DataREady without any async read operation. ExtractVector is expected      ///to be called immediately.      void RequestNextVector() { -        MKQL_ENSURE(State == EState::AcceptingDataRequests, "Internal logic error"); -        MKQL_ENSURE(CurrentVector.empty(), "Internal logic error"); -        MKQL_ENSURE(!StoredChunksElementsCount.empty(), "Internal logic error"); +        MKQL_ENSURE(State_ == EState::AcceptingDataRequests, "Internal logic error"); +        MKQL_ENSURE(CurrentVector_.empty(), "Internal logic error"); +        MKQL_ENSURE(!StoredChunksElementsCount_.empty(), "Internal logic error"); -        CurrentVector.reserve(StoredChunksElementsCount.front()); -        State = EState::RestoringData; +        CurrentVector_.reserve(StoredChunksElementsCount_.front()); +        State_ = EState::RestoringData;          LoadNextVector();      } @@ -123,14 +123,14 @@ public:      ///Finalize will spill all the contents of inner buffer if any.      ///Is case if buffer is not ready async write operation will be started.      void Finalize() { -        MKQL_ENSURE(CurrentVector.empty(), "Internal logic error"); -        if (Buffer.Empty()) { -            State = EState::AcceptingDataRequests; +        MKQL_ENSURE(CurrentVector_.empty(), "Internal logic error"); +        if (Buffer_.Empty()) { +            State_ = EState::AcceptingDataRequests;              return;          }          SaveBuffer(); -        IsFinalizing = true; +        IsFinalizing_ = true;      }  private: @@ -155,71 +155,71 @@ private:      }      void LoadNextVector() { -        auto requestedVectorSize= StoredChunksElementsCount.front(); -        MKQL_ENSURE(requestedVectorSize >= CurrentVector.size(), "Internal logic error"); -        size_t sizeToLoad = (requestedVectorSize - CurrentVector.size()) * sizeof(T); +        auto requestedVectorSize= StoredChunksElementsCount_.front(); +        MKQL_ENSURE(requestedVectorSize >= CurrentVector_.size(), "Internal logic error"); +        size_t sizeToLoad = (requestedVectorSize - CurrentVector_.size()) * sizeof(T); -        if (Buffer.Size() >= sizeToLoad) { +        if (Buffer_.Size() >= sizeToLoad) {              // if all the data for requested vector is ready -            CopyRopeToTheEndOfVector(CurrentVector, Buffer, sizeToLoad); -            Buffer.Erase(sizeToLoad); -            State = EState::DataReady; +            CopyRopeToTheEndOfVector(CurrentVector_, Buffer_, sizeToLoad); +            Buffer_.Erase(sizeToLoad); +            State_ = EState::DataReady;          } else { -            CopyRopeToTheEndOfVector(CurrentVector, Buffer); -            ReadOperation = Spiller->Extract(StoredChunks.front()); +            CopyRopeToTheEndOfVector(CurrentVector_, Buffer_); +            ReadOperation_ = Spiller_->Extract(StoredChunks_.front());          }      }      void SaveBuffer() { -        State = EState::SpillingData; -        WriteOperation = Spiller->Put(std::move(Buffer)); +        State_ = EState::SpillingData; +        WriteOperation_ = Spiller_->Put(std::move(Buffer_));      }      void AddDataToRope(const T* data, size_t count) {          auto owner = std::make_shared<std::vector<T>>(data, data + count);          TStringBuf buf(reinterpret_cast<const char *>(owner->data()), count * sizeof(T)); -        Buffer.Append(buf, owner); +        Buffer_.Append(buf, owner);      }      void SaveNextPartOfVector() { -        size_t maxFittingElemets = (SizeLimit - Buffer.Size()) / sizeof(T); -        size_t remainingElementsInVector = CurrentVector.size() - NextVectorPositionToSave; +        size_t maxFittingElemets = (SizeLimit_ - Buffer_.Size()) / sizeof(T); +        size_t remainingElementsInVector = CurrentVector_.size() - NextVectorPositionToSave_;          size_t elementsToCopyFromVector = std::min(maxFittingElemets, remainingElementsInVector); -        AddDataToRope(CurrentVector.data() + NextVectorPositionToSave, elementsToCopyFromVector); +        AddDataToRope(CurrentVector_.data() + NextVectorPositionToSave_, elementsToCopyFromVector); -        NextVectorPositionToSave += elementsToCopyFromVector; -        if (NextVectorPositionToSave >= CurrentVector.size()) { -            CurrentVector.resize(0); -            NextVectorPositionToSave = 0; +        NextVectorPositionToSave_ += elementsToCopyFromVector; +        if (NextVectorPositionToSave_ >= CurrentVector_.size()) { +            CurrentVector_.resize(0); +            NextVectorPositionToSave_ = 0;          } -        if (SizeLimit - Buffer.Size() < sizeof(T)) { +        if (SizeLimit_ - Buffer_.Size() < sizeof(T)) {              SaveBuffer();              return;          } -        State = EState::AcceptingData; +        State_ = EState::AcceptingData;      }  private: -    EState State = EState::AcceptingData; +    EState State_ = EState::AcceptingData; -    ISpiller::TPtr Spiller; -    const size_t SizeLimit; -    NYql::TChunkedBuffer Buffer; +    ISpiller::TPtr Spiller_; +    const size_t SizeLimit_; +    NYql::TChunkedBuffer Buffer_;      // Used to store vector while spilling and also used while restoring the data -    std::vector<T, Alloc> CurrentVector; -    size_t NextVectorPositionToSave = 0; +    std::vector<T, Alloc> CurrentVector_; +    size_t NextVectorPositionToSave_ = 0; -    std::queue<ISpiller::TKey> StoredChunks; -    std::queue<size_t> StoredChunksElementsCount; +    std::queue<ISpiller::TKey> StoredChunks_; +    std::queue<size_t> StoredChunksElementsCount_; -    std::optional<NThreading::TFuture<ISpiller::TKey>> WriteOperation = std::nullopt; -    std::optional<NThreading::TFuture<std::optional<NYql::TChunkedBuffer>>> ReadOperation = std::nullopt; +    std::optional<NThreading::TFuture<ISpiller::TKey>> WriteOperation_ = std::nullopt; +    std::optional<NThreading::TFuture<std::optional<NYql::TChunkedBuffer>>> ReadOperation_ = std::nullopt; -    bool IsFinalizing = false; +    bool IsFinalizing_ = false;  };  }//namespace NKikimr::NMiniKQL diff --git a/yql/essentials/minikql/computation/mkql_vector_spiller_adapter_ut.cpp b/yql/essentials/minikql/computation/mkql_vector_spiller_adapter_ut.cpp index 43ed19f4897..53fc5f137cd 100644 --- a/yql/essentials/minikql/computation/mkql_vector_spiller_adapter_ut.cpp +++ b/yql/essentials/minikql/computation/mkql_vector_spiller_adapter_ut.cpp @@ -37,7 +37,7 @@ namespace {          while (!spiller.IsAcceptingDataRequests()) {              spiller.Update();          } -         +          for (const auto& vec : vectors) {              spiller.RequestNextVector(); @@ -48,7 +48,7 @@ namespace {              auto extractedVector = spiller.ExtractVector();              UNIT_ASSERT_VALUES_EQUAL(vec, extractedVector); -        }    +        }      }      template <typename T> @@ -100,9 +100,9 @@ Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_SingleVector) {  Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_MultipleVectors) {      template <typename T> -    void ManyDifferentSizes_TestRunner() { +    void ManyDifferentSizesTestRunner() {          std::vector<std::vector<T, TMKQLAllocator<T>>> vectors; -         +          for (int vectorSize = 0; vectorSize <= 100; ++vectorSize) {              vectors.push_back(CreateSimpleVectorOfSize<T>(vectorSize));          } @@ -112,14 +112,14 @@ Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_MultipleVectors) {      Y_UNIT_TEST(ManyDifferentSizes) {          TScopedAlloc Alloc(__LOCATION__); -        ManyDifferentSizes_TestRunner<int>(); -        ManyDifferentSizes_TestRunner<char>(); +        ManyDifferentSizesTestRunner<int>(); +        ManyDifferentSizesTestRunner<char>();      }      template <typename T> -    void ManyDifferentSizesReversed_TestRunner() { +    void ManyDifferentSizesReversedTestRunner() {          std::vector<std::vector<T, TMKQLAllocator<T>>> vectors; -         +          for (int vectorSize = 100; vectorSize >= 0; --vectorSize) {              vectors.push_back(CreateSimpleVectorOfSize<T>(vectorSize));          } @@ -129,14 +129,14 @@ Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_MultipleVectors) {      Y_UNIT_TEST(ManyDifferentSizesReversed) {          TScopedAlloc Alloc(__LOCATION__); -        ManyDifferentSizesReversed_TestRunner<int>(); -        ManyDifferentSizesReversed_TestRunner<char>(); +        ManyDifferentSizesReversedTestRunner<int>(); +        ManyDifferentSizesReversedTestRunner<char>();      }      template <typename T> -    void VectorsInOneChunk_TestRunner() { +    void VectorsInOneChunkTestRunner() {          std::vector<std::vector<T, TMKQLAllocator<T>>> vectors; -         +          size_t totalSize = 0;          for (int vectorSize = 1; vectorSize < 5; ++vectorSize) { @@ -150,14 +150,14 @@ Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_MultipleVectors) {      Y_UNIT_TEST(VectorsInOneChunk) {          TScopedAlloc Alloc(__LOCATION__); -        VectorsInOneChunk_TestRunner<int>(); -        VectorsInOneChunk_TestRunner<char>(); +        VectorsInOneChunkTestRunner<int>(); +        VectorsInOneChunkTestRunner<char>();      }      template <typename T> -    void EmptyVectorsInTheMiddle_TestRunner() { +    void EmptyVectorsInTheMiddleTestRunner() {          std::vector<std::vector<T,TMKQLAllocator<T>>> vectors; -         +          size_t totalSize = 0;          for (int vectorSize = 1; vectorSize < 5; ++vectorSize) { @@ -179,12 +179,12 @@ Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_MultipleVectors) {      Y_UNIT_TEST(EmptyVectorsInTheMiddle) {          TScopedAlloc Alloc(__LOCATION__); -        EmptyVectorsInTheMiddle_TestRunner<int>(); -        EmptyVectorsInTheMiddle_TestRunner<char>(); +        EmptyVectorsInTheMiddleTestRunner<int>(); +        EmptyVectorsInTheMiddleTestRunner<char>();      }      template <typename T> -    void RequestedVectorPartlyInMemory_TestRunner() { +    void RequestedVectorPartlyInMemoryTestRunner() {          std::vector<std::vector<T, TMKQLAllocator<T>>> vectors;          std::vector<T, TMKQLAllocator<T>> small = CreateSimpleVectorOfSize<T>(1);          std::vector<T, TMKQLAllocator<T>> big = CreateSimpleVectorOfSize<T>(10); @@ -200,8 +200,8 @@ Y_UNIT_TEST_SUITE(TVectorSpillerAdapterTest_MultipleVectors) {      Y_UNIT_TEST(RequestedVectorPartlyInMemory) {          TScopedAlloc Alloc(__LOCATION__); -        RequestedVectorPartlyInMemory_TestRunner<int>(); -        RequestedVectorPartlyInMemory_TestRunner<char>(); +        RequestedVectorPartlyInMemoryTestRunner<int>(); +        RequestedVectorPartlyInMemoryTestRunner<char>();      }  } diff --git a/yql/essentials/minikql/computation/presort.cpp b/yql/essentials/minikql/computation/presort.cpp index 0f3cb95d55e..b05bbd3ba68 100644 --- a/yql/essentials/minikql/computation/presort.cpp +++ b/yql/essentials/minikql/computation/presort.cpp @@ -568,107 +568,107 @@ NUdf::TUnboxedValue DecodeImpl(TType* type, TStringBuf& input, const THolderFact  } // NDetail  void TPresortCodec::AddType(NUdf::EDataSlot slot, bool isOptional, bool isDesc) { -    Types.push_back({slot, isOptional, isDesc}); +    Types_.push_back({slot, isOptional, isDesc});  }  void TPresortEncoder::Start() { -    Output.clear(); -    Current = 0; +    Output_.clear(); +    Current_ = 0;  }  void TPresortEncoder::Start(TStringBuf prefix) { -    Output.clear(); +    Output_.clear();      auto data = reinterpret_cast<const ui8*>(prefix.data()); -    Output.insert(Output.begin(), data, data + prefix.size()); -    Current = 0; +    Output_.insert(Output_.begin(), data, data + prefix.size()); +    Current_ = 0;  }  void TPresortEncoder::Encode(const NUdf::TUnboxedValuePod& value) { -    auto& type = Types[Current++]; +    auto& type = Types_[Current_++];      if (type.IsDesc) {          if (type.IsOptional) {              auto hasValue = (bool)value; -            NDetail::EncodeBool<true>(Output, hasValue); +            NDetail::EncodeBool<true>(Output_, hasValue);              if (!hasValue) {                  return;              }          } -        NDetail::Encode<true>(Output, type.Slot, value); +        NDetail::Encode<true>(Output_, type.Slot, value);      } else {          if (type.IsOptional) {              auto hasValue = (bool)value; -            NDetail::EncodeBool<false>(Output, hasValue); +            NDetail::EncodeBool<false>(Output_, hasValue);              if (!hasValue) {                  return;              }          } -        NDetail::Encode<false>(Output, type.Slot, value); +        NDetail::Encode<false>(Output_, type.Slot, value);      }  }  TStringBuf TPresortEncoder::Finish() { -    MKQL_ENSURE(Current == Types.size(), "not all fields were encoded"); -    return TStringBuf((const char*)Output.data(), Output.size()); +    MKQL_ENSURE(Current_ == Types_.size(), "not all fields were encoded"); +    return TStringBuf((const char*)Output_.data(), Output_.size());  }  void TPresortDecoder::Start(TStringBuf input) { -    Input = input; -    Current = 0; +    Input_ = input; +    Current_ = 0;  }  NUdf::TUnboxedValue TPresortDecoder::Decode() { -    auto& type = Types[Current++]; +    auto& type = Types_[Current_++];      if (type.IsDesc) { -        if (type.IsOptional && !NDetail::DecodeBool<true>(Input)) { +        if (type.IsOptional && !NDetail::DecodeBool<true>(Input_)) {              return NUdf::TUnboxedValuePod();          } -        return NDetail::Decode<true>(Input, type.Slot, Buffer); +        return NDetail::Decode<true>(Input_, type.Slot, Buffer_);      } else { -        if (type.IsOptional && !NDetail::DecodeBool<false>(Input)) { +        if (type.IsOptional && !NDetail::DecodeBool<false>(Input_)) {              return NUdf::TUnboxedValuePod();          } -        return NDetail::Decode<false>(Input, type.Slot, Buffer); +        return NDetail::Decode<false>(Input_, type.Slot, Buffer_);      }  }  void TPresortDecoder::Finish() { -    MKQL_ENSURE(Current == Types.size(), "not all fields were decoded"); -    MKQL_ENSURE(Input.empty(), "buffer is not empty"); +    MKQL_ENSURE(Current_ == Types_.size(), "not all fields were decoded"); +    MKQL_ENSURE(Input_.empty(), "buffer is not empty");  }  TGenericPresortEncoder::TGenericPresortEncoder(TType* type) -    : Type(type) +    : Type_(type)  {}  TStringBuf TGenericPresortEncoder::Encode(const NUdf::TUnboxedValue& value, bool desc) { -    Output.clear(); -    NDetail::EncodeValue(Type, value, Output); +    Output_.clear(); +    NDetail::EncodeValue(Type_, value, Output_);      if (desc) { -        for (auto& x : Output) { +        for (auto& x : Output_) {              x = ~x;          }      } -    return TStringBuf((const char*)Output.data(), Output.size()); +    return TStringBuf((const char*)Output_.data(), Output_.size());  }  NUdf::TUnboxedValue TGenericPresortEncoder::Decode(TStringBuf buf, bool desc, const THolderFactory& factory) {      if (desc) { -        Output.assign(buf.begin(), buf.end()); -        for (auto& x : Output) { +        Output_.assign(buf.begin(), buf.end()); +        for (auto& x : Output_) {              x = ~x;          } -        auto newBuf = TStringBuf(reinterpret_cast<const char*>(Output.data()), Output.size()); -        auto ret = NDetail::DecodeImpl(Type, newBuf, factory, Buffer); -        Output.clear(); +        auto newBuf = TStringBuf(reinterpret_cast<const char*>(Output_.data()), Output_.size()); +        auto ret = NDetail::DecodeImpl(Type_, newBuf, factory, Buffer_); +        Output_.clear();          MKQL_ENSURE(newBuf.empty(), "buffer must be empty");          return ret;      } else { -        auto ret = NDetail::DecodeImpl(Type, buf, factory, Buffer); +        auto ret = NDetail::DecodeImpl(Type_, buf, factory, Buffer_);          MKQL_ENSURE(buf.empty(), "buffer is not empty");          return ret;      } diff --git a/yql/essentials/minikql/computation/presort.h b/yql/essentials/minikql/computation/presort.h index b8fc93333cf..6d8a66e78cf 100644 --- a/yql/essentials/minikql/computation/presort.h +++ b/yql/essentials/minikql/computation/presort.h @@ -22,8 +22,8 @@ public:      void AddType(NUdf::EDataSlot slot, bool isOptional = false, bool isDesc = false);  protected: -    size_t Current = 0; -    TVector<TTypeInfo> Types; +    size_t Current_ = 0; +    TVector<TTypeInfo> Types_;  };  class TPresortEncoder : public TPresortCodec { @@ -36,7 +36,7 @@ public:      TStringBuf Finish(); // user must copy  private: -    TVector<ui8> Output; +    TVector<ui8> Output_;  };  class TPresortDecoder : public TPresortCodec { @@ -48,8 +48,8 @@ public:      void Finish();  private: -    TVector<ui8> Buffer; -    TStringBuf Input; +    TVector<ui8> Buffer_; +    TStringBuf Input_;  };  class THolderFactory; @@ -60,9 +60,9 @@ public:      TStringBuf Encode(const NUdf::TUnboxedValue& value, bool desc); // user must copy      NUdf::TUnboxedValue Decode(TStringBuf buf, bool desc, const THolderFactory& factory);  private: -    TType* Type; -    TVector<ui8> Output; -    TVector<ui8> Buffer; +    TType* Type_; +    TVector<ui8> Output_; +    TVector<ui8> Buffer_;  };  } // NMiniKQL diff --git a/yql/essentials/minikql/computation/presort_impl.h b/yql/essentials/minikql/computation/presort_impl.h index 5e3cfe09221..9cca291ca42 100644 --- a/yql/essentials/minikql/computation/presort_impl.h +++ b/yql/essentials/minikql/computation/presort_impl.h @@ -189,31 +189,31 @@ namespace NDetail {          while (!value.empty()) {              union { -                ui8 buffer[BlockSize + 1]; -                ui64 buffer64[BlockSizeUi64]; +                ui8 Buffer[BlockSize + 1]; +                ui64 Buffer64[BlockSizeUi64];              };              part = std::min(value.size(), BlockSize);              if (part == BlockSize) { -                std::memcpy(buffer + 1, value.data(), BlockSize); +                std::memcpy(Buffer + 1, value.data(), BlockSize);              }              else {                  for (size_t i = 0; i < BlockSizeUi64; ++i) { -                    buffer64[i] = 0; +                    Buffer64[i] = 0;                  } -                std::memcpy(buffer + 1, value.data(), part); +                std::memcpy(Buffer + 1, value.data(), part);              }              value.Skip(part); -            buffer[0] = BlockCode; +            Buffer[0] = BlockCode;              if (Desc) {                  for (size_t i = 0; i < BlockSizeUi64; ++i) { -                    buffer64[i] ^= std::numeric_limits<ui64>::max(); +                    Buffer64[i] ^= std::numeric_limits<ui64>::max();                  }              } -            output.insert(output.end(), buffer, buffer + BlockSize + 1); +            output.insert(output.end(), Buffer, Buffer + BlockSize + 1);          }          auto lastLength = ui8(part); @@ -234,22 +234,22 @@ namespace NDetail {          while (code == BlockCode) {              union { -                ui8 buffer[BlockSize + 1]; -                ui64 buffer64[BlockSizeUi64]; +                ui8 Buffer[BlockSize + 1]; +                ui64 Buffer64[BlockSizeUi64];              };              EnsureInputSize(input, BlockSize + 1); -            std::memcpy(buffer, input.data(), BlockSize + 1); +            std::memcpy(Buffer, input.data(), BlockSize + 1);              input.Skip(BlockSize + 1);              if (Desc) {                  for (size_t i = 0; i < BlockSizeUi64; ++i) { -                    buffer64[i] ^= std::numeric_limits<ui64>::max(); +                    Buffer64[i] ^= std::numeric_limits<ui64>::max();                  }              } -            value.insert(value.end(), buffer, buffer + BlockSize); -            code = buffer[BlockSize]; +            value.insert(value.end(), Buffer, Buffer + BlockSize); +            code = Buffer[BlockSize];          }          auto begin = (const char*)value.begin(); | 
