diff --git a/ydb/core/fq/libs/row_dispatcher/common.cpp b/ydb/core/fq/libs/row_dispatcher/common.cpp index 24690f07cfab..50bd7423cb8f 100644 --- a/ydb/core/fq/libs/row_dispatcher/common.cpp +++ b/ydb/core/fq/libs/row_dispatcher/common.cpp @@ -10,22 +10,26 @@ namespace { class TPureCalcProgramFactory : public IPureCalcProgramFactory { public: - NYql::NPureCalc::IProgramFactoryPtr GetFactory(const TSettings& settings) override { - TGuard guard(FactoriesMutex); + TPureCalcProgramFactory() { + CreateFactory({.EnabledLLVM = false}); + CreateFactory({.EnabledLLVM = true}); + } + NYql::NPureCalc::IProgramFactoryPtr GetFactory(const TSettings& settings) const override { const auto it = ProgramFactories.find(settings); - if (it != ProgramFactories.end()) { - return it->second; - } + Y_ENSURE(it != ProgramFactories.end()); + return it->second; + } - return ProgramFactories.insert({settings, NYql::NPureCalc::MakeProgramFactory( +private: + void CreateFactory(const TSettings& settings) { + ProgramFactories.insert({settings, NYql::NPureCalc::MakeProgramFactory( NYql::NPureCalc::TProgramFactoryOptions() .SetLLVMSettings(settings.EnabledLLVM ? "ON" : "OFF") - )}).first->second; + )}); } private: - TMutex FactoriesMutex; std::map ProgramFactories; }; diff --git a/ydb/core/fq/libs/row_dispatcher/common.h b/ydb/core/fq/libs/row_dispatcher/common.h index 8e33787b2767..50f43443b915 100644 --- a/ydb/core/fq/libs/row_dispatcher/common.h +++ b/ydb/core/fq/libs/row_dispatcher/common.h @@ -17,7 +17,7 @@ class IPureCalcProgramFactory : public TThrRefBase { }; public: - virtual NYql::NPureCalc::IProgramFactoryPtr GetFactory(const TSettings& settings) = 0; + virtual NYql::NPureCalc::IProgramFactoryPtr GetFactory(const TSettings& settings) const = 0; }; IPureCalcProgramFactory::TPtr CreatePureCalcProgramFactory(); diff --git a/ydb/library/yql/providers/pq/provider/yql_pq_dq_integration.cpp b/ydb/library/yql/providers/pq/provider/yql_pq_dq_integration.cpp index 9cd28bb424a6..08657e1f8a21 100644 --- a/ydb/library/yql/providers/pq/provider/yql_pq_dq_integration.cpp +++ b/ydb/library/yql/providers/pq/provider/yql_pq_dq_integration.cpp @@ -209,7 +209,6 @@ class TPqDqIntegration: public TDqIntegrationBase { srcDesc.SetClusterType(ToClusterType(clusterDesc->ClusterType)); srcDesc.SetDatabaseId(clusterDesc->DatabaseId); - srcDesc.SetEnabledLLVM(false); if (const auto& types = State_->Types) { if (const auto& optLLVM = types->OptLLVM) { srcDesc.SetEnabledLLVM(!optLLVM->Empty() && *optLLVM != "OFF");