Skip to content

Commit 0544f8f

Browse files
committed
Use target table columns for INSERT into existing table only
1 parent 8a1225f commit 0544f8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,11 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
460460
if (NCommon::NeedToRenamePgSelectColumns(pgSelect)) {
461461
TExprNode::TPtr output;
462462

463-
Y_ENSURE(outTableInfo.RowSpec);
464-
bool result = NCommon::RenamePgSelectColumns(pgSelect, output, outTableInfo.RowSpec->GetColumnOrder(), ctx, *State_->Types);
463+
const auto& columnOrder = (outTableInfo.RowSpec)
464+
? outTableInfo.RowSpec->GetColumnOrder()
465+
: contentColumnOrder;
466+
467+
bool result = NCommon::RenamePgSelectColumns(pgSelect, output, columnOrder, ctx, *State_->Types);
465468
if (!result) {
466469
return TStatus::Error;
467470
}

0 commit comments

Comments
 (0)