Skip to content

Commit

Permalink
Fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriyPA committed Nov 13, 2024
1 parent cf2b376 commit 04543d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
20 changes: 12 additions & 8 deletions ydb/core/fq/libs/row_dispatcher/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@ namespace {

class TPureCalcProgramFactory : public IPureCalcProgramFactory {
public:
NYql::NPureCalc::IProgramFactoryPtr GetFactory(const TSettings& settings) override {
TGuard<TMutex> 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<TSettings, NYql::NPureCalc::IProgramFactoryPtr> ProgramFactories;
};

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/fq/libs/row_dispatcher/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 04543d6

Please sign in to comment.