Skip to content

Commit 423d2b7

Browse files
authored
YQL: Skip logical_id at operation hashing (#7551)
1 parent f010ee3 commit 423d2b7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

ydb/library/yql/providers/yt/provider/yql_yt_op_hash.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "yql_yt_op_hash.h"
33
#include "yql_yt_op_settings.h"
44

5+
#include <ydb/library/yql/dq/type_ann/dq_type_ann.h>
56
#include <ydb/library/yql/providers/yt/expr_nodes/yql_yt_expr_nodes.h>
67
#include <ydb/library/yql/providers/yt/lib/hash/yql_hash_builder.h>
78
#include <ydb/library/yql/utils/log/log.h>
@@ -48,6 +49,37 @@ TYtNodeHashCalculator::TYtNodeHashCalculator(const TYtState::TPtr& state, const
4849
return TString();
4950
};
5051

52+
Hashers[TDqStage::CallableName()] = [this] (const TExprNode& node, TArgIndex& argIndex, ui32 frameLevel) {
53+
THashBuilder builder;
54+
builder << node.Content();
55+
for (size_t i = 0; i < node.ChildrenSize(); ++i) {
56+
// skip _logical_id setting from hashing
57+
if (i == TDqStageBase::idx_Settings) {
58+
for (size_t j = 0; j < node.Child(i)->ChildrenSize(); ++j) {
59+
if((node.Child(i)->Child(j)->Type() == TExprNode::List)
60+
&& node.Child(i)->Child(j)->ChildrenSize() > 0
61+
&& (node.Child(i)->Child(j)->Child(0)->Content() = NDq::TDqStageSettings::LogicalIdSettingName)) {
62+
continue;
63+
}
64+
if (auto partHash = GetHashImpl(*node.Child(i)->Child(j), argIndex, frameLevel)) {
65+
builder << partHash;
66+
}
67+
else {
68+
return TString();
69+
}
70+
}
71+
} else {
72+
if (auto partHash = GetHashImpl(*node.Child(i), argIndex, frameLevel)) {
73+
builder << partHash;
74+
}
75+
else {
76+
return TString();
77+
}
78+
}
79+
}
80+
return builder.Finish();
81+
};
82+
5183
Hashers[TYtOutput::CallableName()] = [this] (const TExprNode& node, TArgIndex& argIndex, ui32 frameLevel) {
5284
return GetOutputHash(node, argIndex, frameLevel);
5385
};

0 commit comments

Comments
 (0)