diff options
author | qrort <31865255+qrort@users.noreply.github.com> | 2024-01-03 13:22:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-03 13:22:31 +0300 |
commit | 1713f65cb03d6fcd725bb9f96356bc579bff9c1f (patch) | |
tree | 47a6ad71b134ea53a1c2d6f042c8880e8f69f3d9 | |
parent | befcdc2455c131b2184d45f8547c8123fc0390f3 (diff) | |
download | ydb-1713f65cb03d6fcd725bb9f96356bc579bff9c1f.tar.gz |
add compatibility for old upsert nodes (#826)
-rw-r--r-- | ydb/core/tx/datashard/datashard_kqp_upsert_rows.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ydb/core/tx/datashard/datashard_kqp_upsert_rows.cpp b/ydb/core/tx/datashard/datashard_kqp_upsert_rows.cpp index d94235e9ef..0a8e3ce35e 100644 --- a/ydb/core/tx/datashard/datashard_kqp_upsert_rows.cpp +++ b/ydb/core/tx/datashard/datashard_kqp_upsert_rows.cpp @@ -169,13 +169,16 @@ private: 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()); |