aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Kovalev <maxkovalev@ydb.tech>2024-08-08 15:13:24 +0300
committerGitHub <noreply@github.com>2024-08-08 12:13:24 +0000
commit423d2b79061b3b9a0728809e62dea5b4a3584ba3 (patch)
treee2febf9c0b9363fac342b517ab0fec367093c96d
parentf010ee3321a68bdf28891cc26f0ebde179794cf0 (diff)
downloadydb-423d2b79061b3b9a0728809e62dea5b4a3584ba3.tar.gz
YQL: Skip logical_id at operation hashing (#7551)
-rw-r--r--ydb/library/yql/providers/yt/provider/yql_yt_op_hash.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ydb/library/yql/providers/yt/provider/yql_yt_op_hash.cpp b/ydb/library/yql/providers/yt/provider/yql_yt_op_hash.cpp
index e80fbb8863..c918d3a652 100644
--- a/ydb/library/yql/providers/yt/provider/yql_yt_op_hash.cpp
+++ b/ydb/library/yql/providers/yt/provider/yql_yt_op_hash.cpp
@@ -2,6 +2,7 @@
#include "yql_yt_op_hash.h"
#include "yql_yt_op_settings.h"
+#include <ydb/library/yql/dq/type_ann/dq_type_ann.h>
#include <ydb/library/yql/providers/yt/expr_nodes/yql_yt_expr_nodes.h>
#include <ydb/library/yql/providers/yt/lib/hash/yql_hash_builder.h>
#include <ydb/library/yql/utils/log/log.h>
@@ -48,6 +49,37 @@ TYtNodeHashCalculator::TYtNodeHashCalculator(const TYtState::TPtr& state, const
return TString();
};
+ Hashers[TDqStage::CallableName()] = [this] (const TExprNode& node, TArgIndex& argIndex, ui32 frameLevel) {
+ THashBuilder builder;
+ builder << node.Content();
+ for (size_t i = 0; i < node.ChildrenSize(); ++i) {
+ // skip _logical_id setting from hashing
+ if (i == TDqStageBase::idx_Settings) {
+ for (size_t j = 0; j < node.Child(i)->ChildrenSize(); ++j) {
+ if((node.Child(i)->Child(j)->Type() == TExprNode::List)
+ && node.Child(i)->Child(j)->ChildrenSize() > 0
+ && (node.Child(i)->Child(j)->Child(0)->Content() = NDq::TDqStageSettings::LogicalIdSettingName)) {
+ continue;
+ }
+ if (auto partHash = GetHashImpl(*node.Child(i)->Child(j), argIndex, frameLevel)) {
+ builder << partHash;
+ }
+ else {
+ return TString();
+ }
+ }
+ } else {
+ if (auto partHash = GetHashImpl(*node.Child(i), argIndex, frameLevel)) {
+ builder << partHash;
+ }
+ else {
+ return TString();
+ }
+ }
+ }
+ return builder.Finish();
+ };
+
Hashers[TYtOutput::CallableName()] = [this] (const TExprNode& node, TArgIndex& argIndex, ui32 frameLevel) {
return GetOutputHash(node, argIndex, frameLevel);
};