Skip to content

Commit 1cf8473

Browse files
Artemonchikdahbka-lis
authored andcommitted
YQL-19940: Support optional default value (#18390)
1 parent b05c4ac commit 1cf8473

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ydb/core/kqp/common/kqp_resolve.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
#include <ydb/core/tx/datashard/range_ops.h>
88
#endif
99

10+
#include <yql/essentials/minikql/mkql_node_builder.h>
11+
1012
namespace NKikimr {
1113
namespace NKqp {
1214

1315
using namespace NMiniKQL;
1416
using namespace NYql;
1517
using namespace NYql::NNodes;
1618

17-
NUdf::TUnboxedValue MakeDefaultValueByType(const NKikimr::NMiniKQL::TType* type) {
19+
NUdf::TUnboxedValue MakeDefaultValueByType(NKikimr::NMiniKQL::TType* type) {
20+
bool isOptional;
21+
type = UnpackOptional(type, isOptional);
22+
Y_ABORT_UNLESS(type->IsData(), "%s", type->GetKindAsStr());
23+
1824
auto dataType = static_cast<const NKikimr::NMiniKQL::TDataType*>(type);
1925
switch (dataType->GetSchemeType()) {
2026
case NUdf::TDataType<bool>::Id:

ydb/core/kqp/common/kqp_resolve.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class TKqpTableKeys {
233233
THashMap<TTableId, TTable> TablesById;
234234
};
235235

236-
NUdf::TUnboxedValue MakeDefaultValueByType(const NKikimr::NMiniKQL::TType* type);
236+
NUdf::TUnboxedValue MakeDefaultValueByType(NKikimr::NMiniKQL::TType* type);
237237

238238
TVector<TCell> MakeKeyCells(const NKikimr::NUdf::TUnboxedValue& value, const TVector<NScheme::TTypeInfo>& keyColumnTypes,
239239
const TVector<ui32>& keyColumnIndices, const NMiniKQL::TTypeEnvironment& typeEnv, bool copyValues);

0 commit comments

Comments
 (0)