@@ -262,33 +262,31 @@ std::vector<TExprBase> ConvertComparisonNode(const TExprBase& nodeIn, const TExp
262262 return YqlIfPushdown (maybeIf.Cast (), argument, ctx);
263263 }
264264
265- if constexpr (NKikimr::NSsa::RuntimeVersion >= 4U ) {
266- if (const auto maybeArithmetic = node.Maybe <TCoBinaryArithmetic>()) {
267- const auto arithmetic = maybeArithmetic.Cast ();
268- if (const auto params = ExtractBinaryFunctionParameters (arithmetic, argument, ctx, pos)) {
269- return Build<TKqpOlapFilterBinaryOp>(ctx, pos)
270- .Operator ().Value (arithmetic.Ref ().Content (), TNodeFlags::Default).Build ()
271- .Left (params->first )
272- .Right (params->second )
273- .Done ();
274- }
265+ if (const auto maybeArithmetic = node.Maybe <TCoBinaryArithmetic>()) {
266+ const auto arithmetic = maybeArithmetic.Cast ();
267+ if (const auto params = ExtractBinaryFunctionParameters (arithmetic, argument, ctx, pos)) {
268+ return Build<TKqpOlapFilterBinaryOp>(ctx, pos)
269+ .Operator ().Value (arithmetic.Ref ().Content (), TNodeFlags::Default).Build ()
270+ .Left (params->first )
271+ .Right (params->second )
272+ .Done ();
275273 }
274+ }
276275
277- if (const auto maybeArithmetic = node.Maybe <TCoUnaryArithmetic>()) {
278- const auto arithmetic = maybeArithmetic.Cast ();
279- if (const auto params = ConvertComparisonNode (arithmetic.Arg (), argument, ctx, pos); 1U == params.size ()) {
280- TString oper (arithmetic.Ref ().Content ());
281- YQL_ENSURE (oper.to_lower ());
282- return Build<TKqpOlapFilterUnaryOp>(ctx, pos)
283- .Operator ().Value (oper, TNodeFlags::Default).Build ()
284- .Arg (params.front ())
285- .Done ();
286- }
276+ if (const auto maybeArithmetic = node.Maybe <TCoUnaryArithmetic>()) {
277+ const auto arithmetic = maybeArithmetic.Cast ();
278+ if (const auto params = ConvertComparisonNode (arithmetic.Arg (), argument, ctx, pos); 1U == params.size ()) {
279+ TString oper (arithmetic.Ref ().Content ());
280+ YQL_ENSURE (oper.to_lower ());
281+ return Build<TKqpOlapFilterUnaryOp>(ctx, pos)
282+ .Operator ().Value (oper, TNodeFlags::Default).Build ()
283+ .Arg (params.front ())
284+ .Done ();
287285 }
286+ }
288287
289- if (const auto maybeCoalesce = node.Maybe <TCoCoalesce>()) {
290- return YqlCoalescePushdown (maybeCoalesce.Cast (), argument, ctx);
291- }
288+ if (const auto maybeCoalesce = node.Maybe <TCoCoalesce>()) {
289+ return YqlCoalescePushdown (maybeCoalesce.Cast (), argument, ctx);
292290 }
293291
294292 if (const auto maybeCompare = node.Maybe <TCoCompare>()) {
@@ -375,7 +373,7 @@ TExprBase BuildOneElementComparison(const std::pair<TExprBase, TExprBase>& param
375373 compareOperator = " gt" ;
376374 } else if (predicate.Maybe <TCoCmpGreaterOrEqual>() && !forceStrictComparison) {
377375 compareOperator = " gte" ;
378- } else if constexpr (NKikimr::NSsa::RuntimeVersion >= 2U ) {
376+ } else {
379377 // We introduced LIKE pushdown in v2 of SSA program
380378 if (predicate.Maybe <TCoCmpStringContains>()) {
381379 compareOperator = " string_contains" ;
@@ -511,16 +509,10 @@ template<bool Empty>
511509TMaybeNode<TExprBase> ExistsPushdown (const TCoExists& exists, TExprContext& ctx, TPositionHandle pos)
512510{
513511 const auto columnName = exists.Optional ().Cast <TCoMember>().Name ();
514- if constexpr (NSsa::RuntimeVersion >= 4U ) {
515- return Build<TKqpOlapFilterUnaryOp>(ctx, pos)
516- .Operator ().Value (Empty ? " empty" : " exists" , TNodeFlags::Default).Build ()
517- .Arg (columnName)
518- .Done ();
519- } else {
520- return Build<TKqpOlapFilterExists>(ctx, pos)
521- .Column (columnName)
512+ return Build<TKqpOlapFilterUnaryOp>(ctx, pos)
513+ .Operator ().Value (Empty ? " empty" : " exists" , TNodeFlags::Default).Build ()
514+ .Arg (columnName)
522515 .Done ();
523- }
524516}
525517
526518TMaybeNode<TExprBase> JsonExistsPushdown (const TCoJsonExists& jsonExists, TExprContext& ctx, TPositionHandle pos)
@@ -571,10 +563,8 @@ TMaybeNode<TExprBase> SafeCastPredicatePushdown(const TCoFlatMap& inputFlatmap,
571563
572564TMaybeNode<TExprBase> CoalescePushdown (const TCoCoalesce& coalesce, const TExprNode& argument, TExprContext& ctx, TPositionHandle pos)
573565{
574- if constexpr (NSsa::RuntimeVersion >= 4U ) {
575- if (const auto node = YqlCoalescePushdown (coalesce, argument, ctx)) {
576- return node;
577- }
566+ if (const auto node = YqlCoalescePushdown (coalesce, argument, ctx)) {
567+ return node;
578568 }
579569
580570 auto predicate = coalesce.Predicate ();
@@ -617,10 +607,8 @@ TFilterOpsLevels PredicatePushdown(const TExprBase& predicate, const TExprNode&
617607
618608 if (const auto maybeNot = predicate.Maybe <TCoNot>()) {
619609 const auto notNode = maybeNot.Cast ();
620- if constexpr (NSsa::RuntimeVersion >= 4U ) {
621- if (const auto maybeExists = notNode.Value ().Maybe <TCoExists>()) {
622- return TFilterOpsLevels (ExistsPushdown<true >(maybeExists.Cast (), ctx, pos));
623- }
610+ if (const auto maybeExists = notNode.Value ().Maybe <TCoExists>()) {
611+ return TFilterOpsLevels (ExistsPushdown<true >(maybeExists.Cast (), ctx, pos));
624612 }
625613 auto pushedFilters = PredicatePushdown (notNode.Value (), argument, ctx, pos);
626614 pushedFilters.WrapToNotOp (ctx, pos);
0 commit comments