aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcherednik <dcherednik@ydb.tech>2023-06-22 22:00:38 +0300
committerdcherednik <dcherednik@ydb.tech>2023-06-22 22:00:38 +0300
commitef380d661dc39e8ff1b8e626d4ff6a2261093263 (patch)
tree0405857cef42ccc5cb2ecba08ee23312cecd2cad
parentf884329f81cf559a1a174b30d57fa6c4adffef76 (diff)
downloadydb-ef380d661dc39e8ff1b8e626d4ff6a2261093263.tar.gz
Fix missed convertation for Tagged, Null, EmptyList and EmptyDict types.
-rw-r--r--ydb/core/kqp/provider/yql_kikimr_results.cpp25
-rw-r--r--ydb/core/kqp/query_compiler/kqp_query_compiler.cpp4
2 files changed, 26 insertions, 3 deletions
diff --git a/ydb/core/kqp/provider/yql_kikimr_results.cpp b/ydb/core/kqp/provider/yql_kikimr_results.cpp
index 1e1c4ae7f3..39981ee14b 100644
--- a/ydb/core/kqp/provider/yql_kikimr_results.cpp
+++ b/ydb/core/kqp/provider/yql_kikimr_results.cpp
@@ -5,8 +5,6 @@
#include <ydb/library/uuid/uuid.h>
#include <ydb/library/yql/providers/common/codec/yql_codec_results.h>
-#include <ydb/library/yql/providers/common/provider/yql_provider.h>
-#include <ydb/library/yql/providers/common/schema/expr/yql_expr_schema.h>
#include <ydb/library/yql/public/decimal/yql_decimal.h>
namespace NYql {
@@ -479,6 +477,29 @@ bool ExportTypeToKikimrProto(const TTypeAnnotationNode& type, NKikimrMiniKQL::TT
return true;
}
+ case ETypeAnnotationKind::Null: {
+ protoType.SetKind(NKikimrMiniKQL::ETypeKind::Null);
+ return true;
+ }
+
+ case ETypeAnnotationKind::EmptyList: {
+ protoType.SetKind(NKikimrMiniKQL::ETypeKind::EmptyList);
+ return true;
+ }
+
+ case ETypeAnnotationKind::EmptyDict: {
+ protoType.SetKind(NKikimrMiniKQL::ETypeKind::EmptyDict);
+ return true;
+ }
+
+ case ETypeAnnotationKind::Tagged: {
+ auto taggedType = type.Cast<TTaggedExprType>();
+ protoType.SetKind(NKikimrMiniKQL::ETypeKind::Tagged);
+ auto target = protoType.MutableTagged();
+ target->SetTag(TString(taggedType->GetTag()));
+ return ExportTypeToKikimrProto(*taggedType->GetBaseType(), *target->MutableItem(), ctx);
+ }
+
case ETypeAnnotationKind::Data: {
protoType.SetKind(NKikimrMiniKQL::ETypeKind::Data);
auto slot = type.Cast<TDataExprType>()->GetSlot();
diff --git a/ydb/core/kqp/query_compiler/kqp_query_compiler.cpp b/ydb/core/kqp/query_compiler/kqp_query_compiler.cpp
index b921dc630f..194be41faa 100644
--- a/ydb/core/kqp/query_compiler/kqp_query_compiler.cpp
+++ b/ydb/core/kqp/query_compiler/kqp_query_compiler.cpp
@@ -511,7 +511,9 @@ public:
NKikimrMiniKQL::TType kikimrProto;
- NYql::ExportTypeToKikimrProto(*type, kikimrProto, ctx);
+ if (!NYql::ExportTypeToKikimrProto(*type, kikimrProto, ctx)) {
+ return false;
+ }
auto resultMeta = queryBindingProto.MutableResultSetMeta();