Skip to content

Commit e57003d

Browse files
committed
YQL-19866: Do not release the finished state
commit_hash:3c10c54803265211cf64d4c98705be92ef0c8486
1 parent 67d4a57 commit e57003d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

yql/essentials/minikql/comp_nodes/mkql_todict.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ class TSqueezeSetFlowWrapper : public TStatefulFlowCodegeneratorNode<TSqueezeSet
985985

986986
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
987987
if (state.IsFinish()) {
988-
return state.Release();
988+
return state;
989989
} else if (state.IsInvalid()) {
990990
MakeState(ctx, state);
991991
}
@@ -1162,7 +1162,7 @@ class TSqueezeSetWideWrapper : public TStatefulFlowCodegeneratorNode<TSqueezeSet
11621162

11631163
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
11641164
if (state.IsFinish()) {
1165-
return state.Release();
1165+
return state;
11661166
} else if (state.IsInvalid()) {
11671167
MakeState(ctx, state);
11681168
}

yql/essentials/minikql/comp_nodes/ut/mkql_todict_ut.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ Y_UNIT_TEST_SUITE(TMiniKQLToDictTest) {
147147

148148
status = res.Fetch(v);
149149
UNIT_ASSERT_VALUES_EQUAL(NUdf::EFetchStatus::Finish, status);
150+
// XXX: Check whether the internal state is not released
151+
// and the sentinel is still set (see more info in YQL-19866).
152+
status = res.Fetch(v);
153+
UNIT_ASSERT_VALUES_EQUAL(NUdf::EFetchStatus::Finish, status);
150154
};
151155

152156
for (auto stream : {true, false}) {
@@ -201,6 +205,10 @@ Y_UNIT_TEST_SUITE(TMiniKQLToDictTest) {
201205

202206
status = res.Fetch(v);
203207
UNIT_ASSERT_VALUES_EQUAL(NUdf::EFetchStatus::Finish, status);
208+
// XXX: Check whether the internal state is not released
209+
// and the sentinel is still set (see more info in YQL-19866).
210+
status = res.Fetch(v);
211+
UNIT_ASSERT_VALUES_EQUAL(NUdf::EFetchStatus::Finish, status);
204212
};
205213

206214
for (auto hashed : {true, false}) {

0 commit comments

Comments
 (0)