summaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/yql_expr_constraint.cpp
diff options
context:
space:
mode:
authorudovichenko-r <[email protected]>2025-04-15 17:28:58 +0300
committerudovichenko-r <[email protected]>2025-04-15 17:45:25 +0300
commit218ec6a31e4d1f39811692f17f54a77a5755ee4c (patch)
tree88ee82921c61e9cc2a15d0e4d0040b446113715e /yql/essentials/core/yql_expr_constraint.cpp
parenta004c2e3c2279e8f31e98d74ed3b7773a34a9557 (diff)
Check missing fields in Cast constraints calculation
commit_hash:80d14b9a81504ea3fcb8d6fa89a2472f700c0f0e
Diffstat (limited to 'yql/essentials/core/yql_expr_constraint.cpp')
-rw-r--r--yql/essentials/core/yql_expr_constraint.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/yql/essentials/core/yql_expr_constraint.cpp b/yql/essentials/core/yql_expr_constraint.cpp
index fdfc21946be..e67557d9645 100644
--- a/yql/essentials/core/yql_expr_constraint.cpp
+++ b/yql/essentials/core/yql_expr_constraint.cpp
@@ -665,12 +665,18 @@ private:
};
const auto filterForUnique = [inItemType, outItemType](const TPartOfConstraintBase::TPathType& path) {
- const auto castResult = CastResult<Strict>(TPartOfConstraintBase::GetSubTypeByPath(path, *inItemType), TPartOfConstraintBase::GetSubTypeByPath(path, *outItemType));
- return NUdf::ECastOptions::Complete == castResult || NUdf::ECastOptions::MayFail == castResult;
+ if (const auto outType = TPartOfConstraintBase::GetSubTypeByPath(path, *outItemType)) {
+ const auto castResult = CastResult<Strict>(TPartOfConstraintBase::GetSubTypeByPath(path, *inItemType), outType);
+ return NUdf::ECastOptions::Complete == castResult || NUdf::ECastOptions::MayFail == castResult;
+ }
+ return false;
};
const auto filterForDistinct = [inItemType, outItemType](const TPartOfConstraintBase::TPathType& path) {
- return NUdf::ECastOptions::Complete == CastResult<Strict>(TPartOfConstraintBase::GetSubTypeByPath(path, *inItemType), TPartOfConstraintBase::GetSubTypeByPath(path, *outItemType));
+ if (const auto outType = TPartOfConstraintBase::GetSubTypeByPath(path, *outItemType)) {
+ return NUdf::ECastOptions::Complete == CastResult<Strict>(TPartOfConstraintBase::GetSubTypeByPath(path, *inItemType), outType);
+ }
+ return false;
};
FilterFromHead<TSortedConstraintNode>(input, filter, ctx);