diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-03-06 17:41:11 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-03-06 17:41:11 +0300 |
commit | e2b27f4c3fe0cceecbddddec5acc66cacd7a5d3f (patch) | |
tree | 2fa2227c1b6eb28ccdab5a49ab4ecd0bb32ffd98 | |
parent | cbc0c479c131a1e63ca86fe98b031e1bcac725d8 (diff) | |
download | ydb-e2b27f4c3fe0cceecbddddec5acc66cacd7a5d3f.tar.gz |
YQL-15703 Always remove sys members on EquiJoin inputs.
-rw-r--r-- | ydb/library/yql/core/type_ann/type_ann_join.cpp | 28 | ||||
-rw-r--r-- | ydb/library/yql/sql/v1/join.cpp | 4 |
2 files changed, 7 insertions, 25 deletions
diff --git a/ydb/library/yql/core/type_ann/type_ann_join.cpp b/ydb/library/yql/core/type_ann/type_ann_join.cpp index 291991c48b..76e22a904d 100644 --- a/ydb/library/yql/core/type_ann/type_ann_join.cpp +++ b/ydb/library/yql/core/type_ann/type_ann_join.cpp @@ -270,22 +270,6 @@ namespace NTypeAnnImpl { } auto structType = itemType->Cast<TStructExprType>(); - if (!options.KeepSysColumns && AnyOf(structType->GetItems(), [](const TItemExprType* structItem) { return structItem->GetName().StartsWith("_yql_sys_"); })) { - if (updatedChildren.empty()) { - updatedChildren = input->ChildrenList(); - } - updatedChildren[idx] = ctx.Expr.ChangeChild(listPair, 0, - ctx.Expr.Builder(list.Pos()) - .Callable("RemovePrefixMembers") - .Add(0, listPair.HeadPtr()) - .List(1) - .Atom(0, "_yql_sys_", TNodeFlags::Default) - .Seal() - .Seal() - .Build() - ); - continue; - } if (auto err = labels.Add(ctx.Expr, *listPair.Child(1), structType)) { ctx.Expr.AddError(*err); ctx.Expr.AddError(TIssue( @@ -541,7 +525,7 @@ namespace NTypeAnnImpl { if (!EnsureTupleOfAtoms(rightKeyColumns, ctx.Expr)) { return IGraphTransformer::TStatus::Error; } - + const auto& leftRenames = *input->Child(5); const auto& rightRenames = *input->Child(6); @@ -602,7 +586,7 @@ namespace NTypeAnnImpl { } else { resultItems[index] = columnType; } - + } for (ui32 i = 0; i < rightRenames.ChildrenSize(); i += 2) { @@ -636,7 +620,7 @@ namespace NTypeAnnImpl { } else { resultItems[index] = columnType; } - + } const auto resultItemType = ctx.Expr.MakeType<TMultiExprType>(resultItems); @@ -650,7 +634,7 @@ namespace NTypeAnnImpl { IGraphTransformer::TStatus GraceJoinCoreWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TContext& ctx) { Y_UNUSED(output); - + if (!EnsureArgsCount(*input, 7, ctx.Expr)) { return IGraphTransformer::TStatus::Error; } @@ -666,11 +650,11 @@ namespace NTypeAnnImpl { } if ( !EnsureWideFlowType(*input->Child(0), ctx.Expr) ) { - return IGraphTransformer::TStatus::Error; + return IGraphTransformer::TStatus::Error; } if ( !EnsureWideFlowType(*input->Child(1), ctx.Expr) ) { - return IGraphTransformer::TStatus::Error; + return IGraphTransformer::TStatus::Error; } return GraceJoinCoreWrapperImp(input, *leftItemType->Cast<TMultiExprType>(), *rightItemType->Cast<TMultiExprType>(), ctx); diff --git a/ydb/library/yql/sql/v1/join.cpp b/ydb/library/yql/sql/v1/join.cpp index 29f5b3ec4b..7851b9809b 100644 --- a/ydb/library/yql/sql/v1/join.cpp +++ b/ydb/library/yql/sql/v1/join.cpp @@ -567,9 +567,7 @@ public: if (extraMembers) { sourceNode = Y(useOrderedForSource ? "OrderedMap" : "Map", sourceNode, BuildLambda(Pos, Y("row"), extraMembers, "row")); } - if (ctx.EnableSystemColumns && source->IsTableSource()) { - sourceNode = Y("RemoveSystemMembers", sourceNode); - } + sourceNode = Y("RemoveSystemMembers", sourceNode); equiJoin = L(equiJoin, Q(Y(sourceNode, BuildQuotedAtom(source->GetPos(), source->GetLabel())))); } TNodePtr removeMembers; |