summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraozeritsky <[email protected]>2023-07-13 12:43:46 +0300
committeraozeritsky <[email protected]>2023-07-13 12:43:46 +0300
commit3e821290327605ba1c4ad4a9cf2ce3b19acb8139 (patch)
treeb041be2b423592bd39cef33d6e20565e63763497
parent4efe1405951a75e533afd6fb036b17a72b2cb130 (diff)
Use YQL_ENSURE macros for exceptions
-rw-r--r--ydb/library/yql/sql/pg/optimizer.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/ydb/library/yql/sql/pg/optimizer.cpp b/ydb/library/yql/sql/pg/optimizer.cpp
index 80f1143593e..5cd4e8bac64 100644
--- a/ydb/library/yql/sql/pg/optimizer.cpp
+++ b/ydb/library/yql/sql/pg/optimizer.cpp
@@ -3,9 +3,9 @@
#include <iostream>
#include <ydb/library/yql/parser/pg_wrapper/arena_ctx.h>
+#include <ydb/library/yql/utils/yql_panic.h>
#include <util/string/builder.h>
-#include <util/generic/yexception.h>
#ifdef _WIN32
#define __restrict
@@ -192,21 +192,15 @@ int TPgOptimizer::MakeOutputJoin(TOutput& output, Path* path) {
} else if (path->type == T_NestPath) {
node.Strategy = EJoinStrategy::Loop;
} else {
- ythrow yexception() << "Uknown pathtype " << (int)path->type;
+ YQL_ENSURE(false, "Uknown pathtype " << (int)path->type);
}
JoinPath* jpath = (JoinPath*)path;
- if (list_length(jpath->joinrestrictinfo) != 1) {
- ythrow yexception() << "Unsupported joinrestrictinfo len";
- }
+ YQL_ENSURE(list_length(jpath->joinrestrictinfo) == 1, "Unsupported joinrestrictinfo len");
RestrictInfo* rinfo = (RestrictInfo*)jpath->joinrestrictinfo->elements[0].ptr_value;
- if (rinfo->left_em->em_expr->type != T_Var) {
- ythrow yexception() << "Unsupported left em type";
- }
- if (rinfo->right_em->em_expr->type != T_Var) {
- ythrow yexception() << "Unsupported right em type";
- }
+ YQL_ENSURE(rinfo->left_em->em_expr->type == T_Var, "Unsupported left em type");
+ YQL_ENSURE(rinfo->right_em->em_expr->type == T_Var, "Unsupported right em type");
Var* left = (Var*)rinfo->left_em->em_expr;
Var* right = (Var*)rinfo->right_em->em_expr;