Skip to content

Commit

Permalink
Remove aux columns in PushDownYtMapOverSortedMerge optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
rvu1024 committed Feb 5, 2024
1 parent 1c39afc commit bb110af
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7435,6 +7435,14 @@ class TYtPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
if (!rowSpec.IsSorted()) {
return node;
}
TMaybeNode<TExprBase> columns;
if (rowSpec.HasAuxColumns()) {
TSet<TStringBuf> members;
for (auto item: rowSpec.GetType()->GetItems()) {
members.insert(item->GetName());
}
columns = TExprBase(ToAtomList(members, merge.Pos(), ctx));
}

auto mergeSection = merge.Input().Item(0);
if (NYql::HasSettingsExcept(mergeSection.Settings().Ref(), EYtSettingType::KeyFilter | EYtSettingType::KeyFilter2)) {
Expand Down Expand Up @@ -7467,7 +7475,10 @@ class TYtPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
.Input()
.Add()
.Paths()
.Add(path)
.Add<TYtPath>()
.InitFrom(path)
.Columns(columns.IsValid() ? columns.Cast() : path.Columns())
.Build()
.Build()
.Settings(section.Settings())
.Build()
Expand Down

0 comments on commit bb110af

Please sign in to comment.