diff options
author | aneporada <aneporada@ydb.tech> | 2022-10-05 17:38:24 +0300 |
---|---|---|
committer | aneporada <aneporada@ydb.tech> | 2022-10-05 17:38:24 +0300 |
commit | 8784416337d4c07db27cc749fb846210f29c622f (patch) | |
tree | 7da49868148427d93c6da5c8b5ad9c770d539192 | |
parent | 0ac5b3508bc535c63db795107ac408b33b8b76cc (diff) | |
download | ydb-8784416337d4c07db27cc749fb846210f29c622f.tar.gz |
Handle TaggedType in CastResult()
-rw-r--r-- | ydb/library/yql/core/yql_expr_type_annotation.cpp | 6 |
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) { |