Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add compatibility for old upsert nodes #826

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ydb/core/tx/datashard/datashard_kqp_upsert_rows.cpp
Original file line number Diff line number Diff line change
@@ -169,13 +169,16 @@ class TKqpUpsertRowsWrapper : public TMutableComputationNode<TKqpUpsertRowsWrapp
IComputationNode* WrapKqpUpsertRows(TCallable& callable, const TComputationNodeFactoryContext& ctx,
TKqpDatashardComputeContext& computeCtx)
{
MKQL_ENSURE_S(callable.GetInputsCount() >= 4);
MKQL_ENSURE_S(callable.GetInputsCount() >= 3);

auto tableNode = callable.GetInput(0);
auto rowsNode = callable.GetInput(1);
auto upsertColumnsNode = callable.GetInput(2);
auto isUpdateNode = callable.GetInput(3);
bool isUpdate = AS_VALUE(TDataLiteral, isUpdateNode)->AsValue().Get<bool>();
bool isUpdate = false;
if (callable.GetInputsCount() >= 4) {
auto isUpdateNode = callable.GetInput(3);
isUpdate = AS_VALUE(TDataLiteral, isUpdateNode)->AsValue().Get<bool>();
}
auto tableId = NKqp::ParseTableId(tableNode);
auto tableInfo = computeCtx.GetTable(tableId);
MKQL_ENSURE(tableInfo, "Table not found: " << tableId.PathId.ToString());