@@ -204,6 +204,15 @@ TMaybeNode<TExprBase> YqlApplyPushdown(const TExprBase& apply, const TExprNode&
204
204
.Done ();
205
205
}
206
206
207
+ TMaybeNode<TExprBase> JsonExistsPushdown (const TCoJsonExists& jsonExists, TExprContext& ctx, TPositionHandle pos)
208
+ {
209
+ auto columnName = jsonExists.Json ().Cast <TCoMember>().Name ();
210
+ return Build<TKqpOlapJsonExists>(ctx, pos)
211
+ .Column (columnName)
212
+ .Path (jsonExists.JsonPath ().Cast <TCoUtf8>())
213
+ .Done ();
214
+ }
215
+
207
216
std::vector<TExprBase> ConvertComparisonNode (const TExprBase& nodeIn, const TExprNode& argument, TExprContext& ctx, TPositionHandle pos)
208
217
{
209
218
std::vector<TExprBase> out;
@@ -249,6 +258,10 @@ std::vector<TExprBase> ConvertComparisonNode(const TExprBase& nodeIn, const TExp
249
258
return builder.Done ();
250
259
}
251
260
261
+ if (auto maybeJsonExists = node.Maybe <TCoJsonExists>()) {
262
+ return JsonExistsPushdown (maybeJsonExists.Cast (), ctx, pos);
263
+ }
264
+
252
265
if (const auto maybeJust = node.Maybe <TCoJust>()) {
253
266
if (const auto params = ConvertComparisonNode (maybeJust.Cast ().Input (), argument, ctx, pos); 1U == params.size ()) {
254
267
return Build<TKqpOlapFilterUnaryOp>(ctx, node.Pos ())
@@ -515,15 +528,6 @@ TMaybeNode<TExprBase> ExistsPushdown(const TCoExists& exists, TExprContext& ctx,
515
528
.Done ();
516
529
}
517
530
518
- TMaybeNode<TExprBase> JsonExistsPushdown (const TCoJsonExists& jsonExists, TExprContext& ctx, TPositionHandle pos)
519
- {
520
- auto columnName = jsonExists.Json ().Cast <TCoMember>().Name ();
521
- return Build<TKqpOlapJsonExists>(ctx, pos)
522
- .Column (columnName)
523
- .Path (jsonExists.JsonPath ().Cast <TCoUtf8>())
524
- .Done ();
525
- }
526
-
527
531
TMaybeNode<TExprBase> SafeCastPredicatePushdown (const TCoFlatMap& inputFlatmap, const TExprNode& argument, TExprContext& ctx, TPositionHandle pos)
528
532
{
529
533
/*
@@ -572,10 +576,7 @@ TMaybeNode<TExprBase> CoalescePushdown(const TCoCoalesce& coalesce, const TExprN
572
576
return SafeCastPredicatePushdown (maybeFlatmap.Cast (), argument, ctx, pos);
573
577
} else if (auto maybePredicate = predicate.Maybe <TCoCompare>()) {
574
578
return SimplePredicatePushdown (maybePredicate.Cast (), argument, ctx, pos);
575
- } else if (auto maybeJsonExists = predicate.Maybe <TCoJsonExists>()) {
576
- return JsonExistsPushdown (maybeJsonExists.Cast (), ctx, pos);
577
579
}
578
-
579
580
return NullNode;
580
581
}
581
582
0 commit comments