Skip to content

Commit 22f58dc

Browse files
authored
[yt provider] Properly clear constraints in YqlRowSpec (#8350)
1 parent 419b953 commit 22f58dc

File tree

23 files changed

+113
-121
lines changed

23 files changed

+113
-121
lines changed

ydb/library/yql/providers/yt/lib/row_spec/yql_row_spec.cpp

+20-18
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ bool TYqlRowSpecInfo::ParseType(const NYT::TNode& rowSpecAttr, TExprContext& ctx
437437

438438
bool TYqlRowSpecInfo::ParseSort(const NYT::TNode& rowSpecAttr, TExprContext& ctx, const TPositionHandle& pos) {
439439
if (rowSpecAttr.HasKey(RowSpecAttrSortMembers) || rowSpecAttr.HasKey(RowSpecAttrSortedBy) || rowSpecAttr.HasKey(RowSpecAttrSortDirections)) {
440-
ClearSortness();
440+
ClearSortness(ctx);
441441
}
442442
if (rowSpecAttr.HasKey(RowSpecAttrSortDirections)) {
443443
for (auto& item: rowSpecAttr[RowSpecAttrSortDirections].AsList()) {
@@ -559,7 +559,7 @@ void TYqlRowSpecInfo::ParseConstraints(const NYT::TNode& rowSpecAttr) {
559559

560560
bool TYqlRowSpecInfo::ValidateSort(const TYTSortInfo& sortInfo, TExprContext& ctx, const TPositionHandle& pos) {
561561
if (sortInfo.Keys.empty() && IsSorted()) {
562-
ClearSortness();
562+
ClearSortness(ctx);
563563
if (!ctx.AddWarning(YqlIssue(ctx.GetPosition(pos), EYqlIssueCode::TIssuesIds_EIssueCode_YT_ROWSPEC_DIFF_SORT,
564564
"Table attribute '_yql_row_spec' defines sorting, but the table is not really sorted. The sorting will be ignored."))) {
565565
return false;
@@ -573,13 +573,13 @@ bool TYqlRowSpecInfo::ValidateSort(const TYTSortInfo& sortInfo, TExprContext& ct
573573
} else if (IsSorted()) {
574574
bool diff = false;
575575
if (SortedBy.size() > sortInfo.Keys.size()) {
576-
ClearSortness(sortInfo.Keys.size());
576+
ClearSortness(ctx, sortInfo.Keys.size());
577577
diff = true;
578578
}
579579
auto backendSort = GetForeignSort();
580580
for (size_t i = 0; i < backendSort.size(); ++i) {
581581
if (backendSort[i].first != sortInfo.Keys[i].first || backendSort[i].second != (bool)sortInfo.Keys[i].second) {
582-
ClearSortness(i);
582+
ClearSortness(ctx, i);
583583
diff = true;
584584
break;
585585
}
@@ -1396,7 +1396,7 @@ const TStructExprType* TYqlRowSpecInfo::GetExtendedType(TExprContext& ctx) const
13961396
return extended ? ctx.MakeType<TStructExprType>(items) : Type;
13971397
}
13981398

1399-
bool TYqlRowSpecInfo::CopySortness(const TYqlRowSpecInfo& from, ECopySort mode) {
1399+
bool TYqlRowSpecInfo::CopySortness(TExprContext& ctx, const TYqlRowSpecInfo& from, ECopySort mode) {
14001400
SortDirections = from.SortDirections;
14011401
SortMembers = from.SortMembers;
14021402
SortedBy = from.SortedBy;
@@ -1408,16 +1408,16 @@ bool TYqlRowSpecInfo::CopySortness(const TYqlRowSpecInfo& from, ECopySort mode)
14081408
for (size_t i = 0; i < SortMembers.size(); ++i) {
14091409
const auto itemNdx = Type->FindItem(SortMembers[i]);
14101410
if (!itemNdx || (SortedBy[i] == SortMembers[i] && Type->GetItems()[*itemNdx]->GetItemType() != SortedByTypes[i])) {
1411-
sortIsChanged = ClearSortness(i);
1411+
sortIsChanged = ClearSortness(ctx, i);
14121412
break;
14131413
} else if (ECopySort::Pure == mode && SortedBy[i] != SortMembers[i]) {
1414-
sortIsChanged = ClearSortness(i);
1414+
sortIsChanged = ClearSortness(ctx, i);
14151415
break;
14161416
}
14171417
}
14181418
if (ECopySort::WithCalc != mode) {
14191419
if (SortMembers.size() < SortedBy.size()) {
1420-
sortIsChanged = ClearSortness(SortMembers.size()) || sortIsChanged;
1420+
sortIsChanged = ClearSortness(ctx, SortMembers.size()) || sortIsChanged;
14211421
}
14221422
}
14231423
}
@@ -1431,42 +1431,42 @@ void TYqlRowSpecInfo::CopyConstraints(const TYqlRowSpecInfo& from) {
14311431
Distinct = from.Distinct;
14321432
}
14331433

1434-
bool TYqlRowSpecInfo::KeepPureSortOnly() {
1434+
bool TYqlRowSpecInfo::KeepPureSortOnly(TExprContext& ctx) {
14351435
bool sortIsChanged = false;
14361436
for (size_t i = 0; i < SortMembers.size(); ++i) {
14371437
if (!Type->FindItem(SortMembers[i])) {
1438-
sortIsChanged = ClearSortness(i);
1438+
sortIsChanged = ClearSortness(ctx, i);
14391439
break;
14401440
} else if (SortedBy[i] != SortMembers[i]) {
1441-
sortIsChanged = ClearSortness(i);
1441+
sortIsChanged = ClearSortness(ctx, i);
14421442
break;
14431443
}
14441444
}
14451445
if (SortMembers.size() < SortedBy.size()) {
1446-
sortIsChanged = ClearSortness(SortMembers.size()) || sortIsChanged;
1446+
sortIsChanged = ClearSortness(ctx, SortMembers.size()) || sortIsChanged;
14471447
}
14481448
return sortIsChanged;
14491449
}
14501450

1451-
bool TYqlRowSpecInfo::ClearNativeDescendingSort() {
1451+
bool TYqlRowSpecInfo::ClearNativeDescendingSort(TExprContext& ctx) {
14521452
for (size_t i = 0; i < SortDirections.size(); ++i) {
14531453
if (!SortDirections[i] && Type->FindItem(SortedBy[i])) {
1454-
return ClearSortness(i);
1454+
return ClearSortness(ctx, i);
14551455
}
14561456
}
14571457
return false;
14581458
}
14591459

1460-
bool TYqlRowSpecInfo::MakeCommonSortness(const TYqlRowSpecInfo& from) {
1460+
bool TYqlRowSpecInfo::MakeCommonSortness(TExprContext& ctx, const TYqlRowSpecInfo& from) {
14611461
bool sortIsChanged = false;
14621462
UniqueKeys = false; // Merge of two and more tables cannot have unique keys
14631463
const size_t resultSize = Min<size_t>(SortMembers.size(), from.SortMembers.size()); // Truncate all calculated columns
14641464
if (SortedBy.size() > resultSize) {
1465-
sortIsChanged = ClearSortness(resultSize);
1465+
sortIsChanged = ClearSortness(ctx, resultSize);
14661466
}
14671467
for (size_t i = 0; i < resultSize; ++i) {
14681468
if (SortMembers[i] != from.SortMembers[i] || SortedBy[i] != from.SortedBy[i] || SortedByTypes[i] != from.SortedByTypes[i] || SortDirections[i] != from.SortDirections[i]) {
1469-
sortIsChanged = ClearSortness(i) || sortIsChanged;
1469+
sortIsChanged = ClearSortness(ctx, i) || sortIsChanged;
14701470
break;
14711471
}
14721472
}
@@ -1482,13 +1482,15 @@ bool TYqlRowSpecInfo::CompareSortness(const TYqlRowSpecInfo& with, bool checkUni
14821482
&& (!checkUniqueFlag || UniqueKeys == with.UniqueKeys);
14831483
}
14841484

1485-
bool TYqlRowSpecInfo::ClearSortness(size_t fromMember) {
1485+
bool TYqlRowSpecInfo::ClearSortness(TExprContext& ctx, size_t fromMember) {
14861486
if (fromMember <= SortMembers.size()) {
14871487
SortMembers.erase(SortMembers.begin() + fromMember, SortMembers.end());
14881488
SortedBy.erase(SortedBy.begin() + fromMember, SortedBy.end());
14891489
SortedByTypes.erase(SortedByTypes.begin() + fromMember, SortedByTypes.end());
14901490
SortDirections.erase(SortDirections.begin() + fromMember, SortDirections.end());
14911491
UniqueKeys = false;
1492+
ConstraintsNode.Clear();
1493+
Sorted = MakeSortConstraint(ctx);
14921494
return true;
14931495
}
14941496
return false;

ydb/library/yql/providers/yt/lib/row_spec/yql_row_spec.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ struct TYqlRowSpecInfo: public TThrRefBase {
6060
// Includes aux columns
6161
const TStructExprType* GetExtendedType(TExprContext& ctx) const;
6262
// Returns true if sortness is changed
63-
bool CopySortness(const TYqlRowSpecInfo& from, ECopySort mode = ECopySort::Pure);
63+
bool CopySortness(TExprContext& ctx, const TYqlRowSpecInfo& from, ECopySort mode = ECopySort::Pure);
6464
// Returns true if sortness is changed
65-
bool MakeCommonSortness(const TYqlRowSpecInfo& from);
65+
bool MakeCommonSortness(TExprContext& ctx, const TYqlRowSpecInfo& from);
6666
bool CompareSortness(const TYqlRowSpecInfo& with, bool checkUniqueFlag = true) const;
6767
// Returns true if sortness is changed
68-
bool ClearSortness(size_t fromMember = 0);
68+
bool ClearSortness(TExprContext& ctx, size_t fromMember = 0);
6969
// Returns true if sortness is changed
70-
bool KeepPureSortOnly();
71-
bool ClearNativeDescendingSort();
70+
bool KeepPureSortOnly(TExprContext& ctx);
71+
bool ClearNativeDescendingSort(TExprContext& ctx);
7272
const TSortedConstraintNode* MakeSortConstraint(TExprContext& ctx) const;
7373
const TDistinctConstraintNode* MakeDistinctConstraint(TExprContext& ctx) const;
7474
void CopyConstraints(const TYqlRowSpecInfo& from);

ydb/library/yql/providers/yt/provider/phy_opt/yql_yt_phy_opt_misc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::TakeOrSkip(TExprBase no
345345
if (!IsOutputUsedMultipleTimes(map.Ref(), *getParents())) {
346346
TYtOutTableInfo mapOut(map.Output().Item(0));
347347
if (mapOut.RowSpec->IsSorted()) {
348-
mapOut.RowSpec->ClearSortness();
348+
mapOut.RowSpec->ClearSortness(ctx);
349349
input = Build<TYtOutput>(ctx, input.Pos())
350350
.InitFrom(input.Cast<TYtOutput>())
351351
.Operation<TYtMap>()

ydb/library/yql/providers/yt/provider/phy_opt/yql_yt_phy_opt_sort.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::YtSortOverAlreadySorted
2929
TYqlRowSpecInfo commonSorted = outRowSpec;
3030
auto section = sort.Input().Item(0);
3131
for (auto path: section.Paths()) {
32-
commonSorted.MakeCommonSortness(*TYtTableBaseInfo::GetRowSpec(path.Table()));
32+
commonSorted.MakeCommonSortness(ctx, *TYtTableBaseInfo::GetRowSpec(path.Table()));
3333
}
3434

3535
if (outRowSpec.CompareSortness(commonSorted)) {
@@ -198,7 +198,7 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::Sort(TExprBase node, TE
198198
if (canUseMerge) {
199199
TYqlRowSpecInfo commonSorted = *sortOut.RowSpec;
200200
for (auto& pathInfo: inputInfos) {
201-
commonSorted.MakeCommonSortness(*pathInfo->Table->RowSpec);
201+
commonSorted.MakeCommonSortness(ctx, *pathInfo->Table->RowSpec);
202202
}
203203
// input is sorted at least as strictly as output
204204
if (!sortOut.RowSpec->CompareSortness(commonSorted)) {
@@ -533,8 +533,8 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::AssumeSorted(TExprBase
533533
&& firstNativeType == path->GetNativeYtType();
534534
});
535535
if (canMerge) {
536-
outTable.RowSpec->CopySortness(*inputPaths.front()->Table->RowSpec, TYqlRowSpecInfo::ECopySort::WithDesc);
537-
outTable.RowSpec->ClearSortness(sorted->GetContent().size());
536+
outTable.RowSpec->CopySortness(ctx, *inputPaths.front()->Table->RowSpec, TYqlRowSpecInfo::ECopySort::WithDesc);
537+
outTable.RowSpec->ClearSortness(ctx, sorted->GetContent().size());
538538
outTable.SetUnique(assume.Ref().GetConstraint<TDistinctConstraintNode>(), assume.Pos(), ctx);
539539
if (firstNativeType) {
540540
outTable.RowSpec->CopyTypeOrders(*firstNativeType);

ydb/library/yql/providers/yt/provider/phy_opt/yql_yt_phy_opt_write.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::Write(TExprBase node, T
392392
}
393393
} else {
394394
if (inputPaths.size() == 1 && inputPaths.front()->Table->RowSpec && inputPaths.front()->Table->RowSpec->IsSorted()) {
395-
outTable.RowSpec->CopySortness(*inputPaths.front()->Table->RowSpec);
395+
outTable.RowSpec->CopySortness(ctx, *inputPaths.front()->Table->RowSpec);
396396
}
397397
}
398398
}
@@ -406,12 +406,12 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::Write(TExprBase node, T
406406
bool hasAux = inputPaths.front()->Table->RowSpec->HasAuxColumns();
407407
bool sortIsChanged = inputPaths.front()->Table->IsUnordered
408408
? inputPaths.front()->Table->RowSpec->IsSorted()
409-
: outTable.RowSpec->CopySortness(*inputPaths.front()->Table->RowSpec,
409+
: outTable.RowSpec->CopySortness(ctx, *inputPaths.front()->Table->RowSpec,
410410
exactCopySort ? TYqlRowSpecInfo::ECopySort::Exact : TYqlRowSpecInfo::ECopySort::WithDesc);
411411
useExplicitColumns = useExplicitColumns || (inputPaths.front()->HasColumns() && hasAux);
412412

413413
for (size_t i = 1; i < inputPaths.size(); ++i) {
414-
sortIsChanged = outTable.RowSpec->MakeCommonSortness(*inputPaths[i]->Table->RowSpec) || sortIsChanged;
414+
sortIsChanged = outTable.RowSpec->MakeCommonSortness(ctx, *inputPaths[i]->Table->RowSpec) || sortIsChanged;
415415
const bool tableHasAux = inputPaths[i]->Table->RowSpec->HasAuxColumns();
416416
hasAux = hasAux || tableHasAux;
417417
if (inputPaths[i]->HasColumns() && tableHasAux) {

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,15 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
608608
if (initialWrite) {
609609
++nextDescription.WriteValidateCount;
610610
if (nextDescription.IsReplaced) {
611-
nextDescription.RowSpec->CopySortness(*contentRowSpecs.front(), TYqlRowSpecInfo::ECopySort::Exact);
611+
nextDescription.RowSpec->CopySortness(ctx, *contentRowSpecs.front(), TYqlRowSpecInfo::ECopySort::Exact);
612612
if (auto contentNativeType = contentRowSpecs.front()->GetNativeYtType()) {
613613
nextDescription.RowSpec->CopyTypeOrders(*contentNativeType);
614614
}
615615
from = 1;
616616
} else {
617617
nextDescription.MonotonicKeys = monotonicKeys;
618618
if (description.RowSpec) {
619-
nextDescription.RowSpec->CopySortness(*description.RowSpec, TYqlRowSpecInfo::ECopySort::Exact);
619+
nextDescription.RowSpec->CopySortness(ctx, *description.RowSpec, TYqlRowSpecInfo::ECopySort::Exact);
620620
const auto currNativeType = description.RowSpec->GetNativeYtType();
621621
if (currNativeType && nextDescription.RowSpec->GetNativeYtType() != currNativeType) {
622622
nextDescription.RowSpec->CopyTypeOrders(*currNativeType);
@@ -644,7 +644,7 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
644644

645645
const bool uniqueKeys = nextDescription.RowSpec->UniqueKeys;
646646
for (size_t s = from; s < contentRowSpecs.size(); ++s) {
647-
const bool hasSortChanges = nextDescription.RowSpec->MakeCommonSortness(*contentRowSpecs[s]);
647+
const bool hasSortChanges = nextDescription.RowSpec->MakeCommonSortness(ctx, *contentRowSpecs[s]);
648648
const bool breaksSorting = hasSortChanges || !nextDescription.RowSpec->CompareSortness(*contentRowSpecs[s], false);
649649
if (monotonicKeys) {
650650
if (breaksSorting) {
@@ -1763,7 +1763,7 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
17631763
for (auto out: publish.Input()) {
17641764
contentRowSpecs.push_back(MakeIntrusive<TYqlRowSpecInfo>(GetOutTable(out).Cast<TYtOutTable>().RowSpec()));
17651765
if (IsUnorderedOutput(out)) {
1766-
contentRowSpecs.back()->ClearSortness();
1766+
contentRowSpecs.back()->ClearSortness(ctx);
17671767
}
17681768
}
17691769
TExprNode::TPtr content; // Don't try to convert content

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,8 @@ IGraphTransformer::TStatus UpdateTableMeta(const TExprNode::TPtr& tableNode, TEx
974974
tableInfo.RowSpec->CopyTypeOrders(*nativeType);
975975
}
976976
if (prevRowSpec->IsSorted()) {
977-
tableInfo.RowSpec->CopySortness(*prevRowSpec, TYqlRowSpecInfo::ECopySort::WithDesc);
978-
tableInfo.RowSpec->MakeCommonSortness(*prevRowSpec); // Truncated keys with changed types
977+
tableInfo.RowSpec->CopySortness(ctx, *prevRowSpec, TYqlRowSpecInfo::ECopySort::WithDesc);
978+
tableInfo.RowSpec->MakeCommonSortness(ctx, *prevRowSpec); // Truncated keys with changed types
979979
}
980980
}
981981
}
@@ -1419,7 +1419,7 @@ TYtPath CopyOrTrivialMap(TPositionHandle pos, TExprBase world, TYtDSink dataSink
14191419
bool sortIsChanged = false;
14201420
for (size_t i = 0; i < rowSpecs.size(); ++i) {
14211421
if (!rowSpecs[i].first) {
1422-
sortIsChanged = outTable.RowSpec->ClearSortness();
1422+
sortIsChanged = outTable.RowSpec->ClearSortness(ctx);
14231423
continue;
14241424
}
14251425
if (0 == i) {
@@ -1433,11 +1433,11 @@ TYtPath CopyOrTrivialMap(TPositionHandle pos, TExprBase world, TYtDSink dataSink
14331433
? TYqlRowSpecInfo::ECopySort::Exact
14341434
: TYqlRowSpecInfo::ECopySort::WithDesc;
14351435
}
1436-
sortIsChanged = outTable.RowSpec->CopySortness(*rowSpecs[i].first, mode);
1436+
sortIsChanged = outTable.RowSpec->CopySortness(ctx, *rowSpecs[i].first, mode);
14371437
} else {
1438-
sortIsChanged = outTable.RowSpec->MakeCommonSortness(*rowSpecs[i].first) || sortIsChanged;
1438+
sortIsChanged = outTable.RowSpec->MakeCommonSortness(ctx, *rowSpecs[i].first) || sortIsChanged;
14391439
if (rowSpecs[i].second && !sortConstraintEnabled) {
1440-
sortIsChanged = outTable.RowSpec->KeepPureSortOnly() || sortIsChanged;
1440+
sortIsChanged = outTable.RowSpec->KeepPureSortOnly(ctx) || sortIsChanged;
14411441
}
14421442
}
14431443
}
@@ -1507,7 +1507,7 @@ TYtPath CopyOrTrivialMap(TPositionHandle pos, TExprBase world, TYtDSink dataSink
15071507
.Body("stream")
15081508
.Done().Ptr();
15091509

1510-
mapOutTable.RowSpec->CopySortness(*rowSpecs[i].first, sortConstraintEnabled ? TYqlRowSpecInfo::ECopySort::WithDesc : TYqlRowSpecInfo::ECopySort::Pure);
1510+
mapOutTable.RowSpec->CopySortness(ctx, *rowSpecs[i].first, sortConstraintEnabled ? TYqlRowSpecInfo::ECopySort::WithDesc : TYqlRowSpecInfo::ECopySort::Pure);
15111511
if (sortConstraintEnabled) {
15121512
TKeySelectorBuilder builder(path.Pos(), ctx, useNativeDescSort, scheme.Cast<TStructExprType>());
15131513
builder.ProcessRowSpec(*mapOutTable.RowSpec);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class TYtLoadTableMetadataTransformer : public TGraphTransformerBase {
192192
if (!rowSpec->Parse(tableDesc.Meta->Attrs, ctx)) {
193193
return TStatus::Error;
194194
}
195-
if (!State_->Configuration->UseNativeDescSort.Get().GetOrElse(false) && rowSpec->ClearNativeDescendingSort()) {
195+
if (!State_->Configuration->UseNativeDescSort.Get().GetOrElse(false) && rowSpec->ClearNativeDescendingSort(ctx)) {
196196
if (!ctx.AddWarning(YqlIssue(TPosition(), EYqlIssueCode::TIssuesIds_EIssueCode_YT_NATIVE_DESC_SORT_IGNORED, "Native descending sort is ignored"))) {
197197
return TStatus::Error;
198198
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class TYtLogicalOptProposalTransformer : public TOptimizeTransformerBase {
227227
}
228228
}
229229
} else {
230-
mapOut.RowSpec->CopySortness(TYqlRowSpecInfo(map.Output().Item(0).RowSpec()));
230+
mapOut.RowSpec->CopySortness(ctx, TYqlRowSpecInfo(map.Output().Item(0).RowSpec()));
231231
}
232232
mapOut.SetUnique(path.Ref().GetConstraint<TDistinctConstraintNode>(), map.Mapper().Pos(), ctx);
233233

@@ -266,7 +266,7 @@ class TYtLogicalOptProposalTransformer : public TOptimizeTransformerBase {
266266
}
267267

268268
TYtOutTableInfo mergeOut(ctx.MakeType<TStructExprType>(structItems), prevRowSpec.GetNativeYtTypeFlags());
269-
mergeOut.RowSpec->CopySortness(prevRowSpec, TYqlRowSpecInfo::ECopySort::WithDesc);
269+
mergeOut.RowSpec->CopySortness(ctx, prevRowSpec, TYqlRowSpecInfo::ECopySort::WithDesc);
270270
if (auto nativeType = prevRowSpec.GetNativeYtType()) {
271271
mergeOut.RowSpec->CopyTypeOrders(*nativeType);
272272
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ TYtSection MakeEmptySection(TYtSection section, NNodes::TYtDSink dataSink, bool
370370
if (section.Paths().Size() == 1) {
371371
auto srcTableInfo = TYtTableBaseInfo::Parse(section.Paths().Item(0).Table());
372372
if (keepSortness && srcTableInfo->RowSpec && srcTableInfo->RowSpec->IsSorted()) {
373-
outTable.RowSpec->CopySortness(*srcTableInfo->RowSpec, TYqlRowSpecInfo::ECopySort::WithCalc);
373+
outTable.RowSpec->CopySortness(ctx, *srcTableInfo->RowSpec, TYqlRowSpecInfo::ECopySort::WithCalc);
374374
}
375375
}
376376
outTable.SetUnique(section.Ref().GetConstraint<TDistinctConstraintNode>(), section.Pos(), ctx);

0 commit comments

Comments
 (0)