diff options
| author | udovichenko-r <[email protected]> | 2025-04-15 17:28:58 +0300 |
|---|---|---|
| committer | udovichenko-r <[email protected]> | 2025-04-15 17:45:25 +0300 |
| commit | 218ec6a31e4d1f39811692f17f54a77a5755ee4c (patch) | |
| tree | 88ee82921c61e9cc2a15d0e4d0040b446113715e /yql/essentials/core/yql_expr_constraint.cpp | |
| parent | a004c2e3c2279e8f31e98d74ed3b7773a34a9557 (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.cpp | 12 |
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); |
