diff options
4 files changed, 28 insertions, 1 deletions
diff --git a/yql/essentials/providers/common/config/yql_dispatch.cpp b/yql/essentials/providers/common/config/yql_dispatch.cpp index 5a8b2573b1a..2e195720394 100644 --- a/yql/essentials/providers/common/config/yql_dispatch.cpp +++ b/yql/essentials/providers/common/config/yql_dispatch.cpp @@ -102,7 +102,7 @@ bool TSettingDispatcher::Dispatch(const TString& cluster, const TString& name, c auto normalizedName = NormalizeName(name); if (auto handler = Handlers.Value(normalizedName, TSettingHandler::TPtr())) { if (cluster != ALL_CLUSTERS) { - if (!handler->IsRuntime()) { + if (!handler->IsPerCluster()) { return errorCallback(TStringBuilder() << "Static setting " << name.Quote() << " cannot be set for specific cluster", true); } if (!ValidClusters.contains(cluster)) { diff --git a/yql/essentials/providers/common/config/yql_dispatch.h b/yql/essentials/providers/common/config/yql_dispatch.h index bec237df32e..b4d63aecf11 100644 --- a/yql/essentials/providers/common/config/yql_dispatch.h +++ b/yql/essentials/providers/common/config/yql_dispatch.h @@ -148,6 +148,7 @@ public: virtual void FreezeDefault() = 0; virtual void Restore(const TString& cluster) = 0; virtual bool IsRuntime() const = 0; + virtual bool IsPerCluster() const = 0; protected: TString Name_; @@ -230,6 +231,10 @@ public: return Setting_.IsRuntime(); } + bool IsPerCluster() const override { + return Setting_.IsPerCluster(); + } + TSettingHandlerImpl& Lower(TType lower) { Validators_.push_back([lower](const TString&, TType value) { if (value < lower) { diff --git a/yql/essentials/providers/common/config/yql_setting.h b/yql/essentials/providers/common/config/yql_setting.h index 3b2110fbf28..64f15af88dd 100644 --- a/yql/essentials/providers/common/config/yql_setting.h +++ b/yql/essentials/providers/common/config/yql_setting.h @@ -41,6 +41,14 @@ public: #endif } + bool IsPerCluster() const { +#ifdef YQL_BETTER_CONF_SETTING_API + return SettingType == EConfSettingType::Dynamic || SettingType == EConfSettingType::StaticPerCluster; +#else + return RUNTIME || PERCLUSTER; +#endif + } + TType& operator[](const TString& cluster) { if (ALL_CLUSTERS == cluster) { PerClusterValue.clear(); @@ -113,6 +121,10 @@ public: return false; } + bool IsPerCluster() const { + return false; + } + TType& operator[](const TString& cluster) { if (cluster != ALL_CLUSTERS) { ythrow yexception() << "Global static setting cannot be set for specific cluster"; diff --git a/yt/yql/tests/sql/suites/multicluster/externaltx.sql b/yt/yql/tests/sql/suites/multicluster/externaltx.sql new file mode 100644 index 00000000000..a2e104e2d85 --- /dev/null +++ b/yt/yql/tests/sql/suites/multicluster/externaltx.sql @@ -0,0 +1,10 @@ +/* postgres can not */ +/* yt can not */ +pragma yt.RuntimeCluster='banach'; +pragma yt.RuntimeClusterSelection='auto'; +pragma plato.ExternalTx='0-0-0-0'; +pragma banach.ExternalTx='0-0-0-0'; + +select * from plato.PInput where key > "0" +union all +select * from banach.BInput where key = "150" |
