Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
iverase committed Jul 3, 2024
1 parent 355d40c commit 57a5d5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ protected static boolean isAttributePushable(
return false;
}

private static boolean isPushableFieldAttribute(Expression exp, Predicate<FieldAttribute> hasIdenticalDelegate) {
public static boolean isPushableFieldAttribute(Expression exp, Predicate<FieldAttribute> hasIdenticalDelegate) {
if (exp instanceof FieldAttribute fa && fa.getExactInfo().hasExact() && isAggregatable(fa)) {
return fa.dataType() != DataType.TEXT || hasIdenticalDelegate.test(fa);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ protected PhysicalPlan rule(TopNExec topNExec, LocalPhysicalOptimizerContext ctx

private boolean canPushDownOrders(List<Order> orders, Predicate<FieldAttribute> hasIdenticalDelegate) {
// allow only exact FieldAttributes (no expressions) for sorting
return orders.stream().allMatch(o -> o.child().canPushToSource(hasIdenticalDelegate));
return orders.stream().allMatch(o -> Expression.isPushableFieldAttribute(o.child(), hasIdenticalDelegate));
}

private List<EsQueryExec.FieldSort> buildFieldSorts(List<Order> orders) {
Expand Down

0 comments on commit 57a5d5c

Please sign in to comment.