aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2022-09-05 12:11:44 +0300
committeraneporada <aneporada@ydb.tech>2022-09-05 12:11:44 +0300
commitcbdfdc30a59b809a7a578d417c5b19e51afa8d07 (patch)
tree710755e6784ed032dc2b76bc80c769ac6c66f57b
parent7cf7de710c1f50c20a229d12b33d18b8f4f0f736 (diff)
downloadydb-cbdfdc30a59b809a7a578d417c5b19e51afa8d07.tar.gz
[] Avoid unneded optionals and SkipNullMemers when deriving unified join key type
-rw-r--r--ydb/library/yql/core/yql_join.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/ydb/library/yql/core/yql_join.cpp b/ydb/library/yql/core/yql_join.cpp
index 7ec3afeba06..b6e1861badc 100644
--- a/ydb/library/yql/core/yql_join.cpp
+++ b/ydb/library/yql/core/yql_join.cpp
@@ -1270,18 +1270,22 @@ TExprNode::TPtr RemapNonConvertibleMemberForJoin(TPositionHandle pos, const TExp
}
if (RemoveOptionalType(&unifiedType)->GetKind() != ETypeAnnotationKind::Data) {
- result = ctx.Builder(pos)
- .Callable("If")
- .Callable(0, "HasNull")
- .Add(0, result)
- .Seal()
- .Callable(1, "Null")
- .Seal()
- .Callable(2, "StablePickle")
- .Add(0, result)
+ if (unifiedType.HasOptionalOrNull()) {
+ result = ctx.Builder(pos)
+ .Callable("If")
+ .Callable(0, "HasNull")
+ .Add(0, result)
+ .Seal()
+ .Callable(1, "Null")
+ .Seal()
+ .Callable(2, "StablePickle")
+ .Add(0, result)
+ .Seal()
.Seal()
- .Seal()
- .Build();
+ .Build();
+ } else {
+ result = ctx.NewCallable(pos, "StablePickle", { result });
+ }
}
return result;