@@ -262,33 +262,31 @@ std::vector<TExprBase> ConvertComparisonNode(const TExprBase& nodeIn, const TExp
262
262
return YqlIfPushdown (maybeIf.Cast (), argument, ctx);
263
263
}
264
264
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 ();
275
273
}
274
+ }
276
275
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 ();
287
285
}
286
+ }
288
287
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);
292
290
}
293
291
294
292
if (const auto maybeCompare = node.Maybe <TCoCompare>()) {
@@ -375,7 +373,7 @@ TExprBase BuildOneElementComparison(const std::pair<TExprBase, TExprBase>& param
375
373
compareOperator = " gt" ;
376
374
} else if (predicate.Maybe <TCoCmpGreaterOrEqual>() && !forceStrictComparison) {
377
375
compareOperator = " gte" ;
378
- } else if constexpr (NKikimr::NSsa::RuntimeVersion >= 2U ) {
376
+ } else {
379
377
// We introduced LIKE pushdown in v2 of SSA program
380
378
if (predicate.Maybe <TCoCmpStringContains>()) {
381
379
compareOperator = " string_contains" ;
@@ -511,16 +509,10 @@ template<bool Empty>
511
509
TMaybeNode<TExprBase> ExistsPushdown (const TCoExists& exists, TExprContext& ctx, TPositionHandle pos)
512
510
{
513
511
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)
522
515
.Done ();
523
- }
524
516
}
525
517
526
518
TMaybeNode<TExprBase> JsonExistsPushdown (const TCoJsonExists& jsonExists, TExprContext& ctx, TPositionHandle pos)
@@ -571,10 +563,8 @@ TMaybeNode<TExprBase> SafeCastPredicatePushdown(const TCoFlatMap& inputFlatmap,
571
563
572
564
TMaybeNode<TExprBase> CoalescePushdown (const TCoCoalesce& coalesce, const TExprNode& argument, TExprContext& ctx, TPositionHandle pos)
573
565
{
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;
578
568
}
579
569
580
570
auto predicate = coalesce.Predicate ();
@@ -617,10 +607,8 @@ TFilterOpsLevels PredicatePushdown(const TExprBase& predicate, const TExprNode&
617
607
618
608
if (const auto maybeNot = predicate.Maybe <TCoNot>()) {
619
609
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));
624
612
}
625
613
auto pushedFilters = PredicatePushdown (notNode.Value (), argument, ctx, pos);
626
614
pushedFilters.WrapToNotOp (ctx, pos);
0 commit comments