aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2022-10-05 17:38:24 +0300
committeraneporada <aneporada@ydb.tech>2022-10-05 17:38:24 +0300
commit8784416337d4c07db27cc749fb846210f29c622f (patch)
tree7da49868148427d93c6da5c8b5ad9c770d539192
parent0ac5b3508bc535c63db795107ac408b33b8b76cc (diff)
downloadydb-8784416337d4c07db27cc749fb846210f29c622f.tar.gz
Handle TaggedType in CastResult()
-rw-r--r--ydb/library/yql/core/yql_expr_type_annotation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ydb/library/yql/core/yql_expr_type_annotation.cpp b/ydb/library/yql/core/yql_expr_type_annotation.cpp
index de7da96eeb8..fe17854c998 100644
--- a/ydb/library/yql/core/yql_expr_type_annotation.cpp
+++ b/ydb/library/yql/core/yql_expr_type_annotation.cpp
@@ -1476,6 +1476,8 @@ NUdf::TCastResultOptions CastResult(const TTypeAnnotationNode* source, const TTy
switch (sKind) {
case ETypeAnnotationKind::Void:
case ETypeAnnotationKind::Null:
+ case ETypeAnnotationKind::EmptyList:
+ case ETypeAnnotationKind::EmptyDict:
return NUdf::ECastOptions::Complete;
case ETypeAnnotationKind::Optional:
return CastResult<Strong>(source->Cast<TOptionalExprType>(), target->Cast<TOptionalExprType>());
@@ -1499,6 +1501,10 @@ NUdf::TCastResultOptions CastResult(const TTypeAnnotationNode* source, const TTy
return CastResult<Strong>(source->Cast<TFlowExprType>(), target->Cast<TFlowExprType>());
case ETypeAnnotationKind::Resource:
return source->Cast<TResourceExprType>()->GetTag() == target->Cast<TResourceExprType>()->GetTag() ? NUdf::ECastOptions::Complete : NUdf::ECastOptions::Impossible;
+ case ETypeAnnotationKind::Tagged:
+ return source->Cast<TTaggedExprType>()->GetTag() == target->Cast<TTaggedExprType>()->GetTag() ?
+ CastResult<Strong>(source->Cast<TTaggedExprType>()->GetBaseType(), target->Cast<TTaggedExprType>()->GetBaseType()) :
+ NUdf::ECastOptions::Impossible;
default: break;
}
} else if (sKind == ETypeAnnotationKind::Null) {