zhuqi-lucas commented on code in PR #19433:
URL: https://github.com/apache/datafusion/pull/19433#discussion_r2674577651
##########
datafusion/physical-expr-common/src/sort_expr.rs:
##########
@@ -427,6 +427,21 @@ impl LexOrdering {
true
}
+ /// Checks if `other` is a prefix of this `LexOrdering`.
+ pub fn is_prefix(&self, other: &LexOrdering) -> bool {
Review Comment:
Minor, we can add more comments for this since we don't use ordering_satisfy.
```suggestion
/// Checks if `other` is a literal prefix of this `LexOrdering`.
///
/// This performs a simple structural check without considering equivalences
/// or constants. For semantic ordering satisfaction checking, use
/// `EquivalenceProperties::ordering_satisfy()` instead.
///
/// # Returns
/// `true` if every expression in `other` appears at the start of `self` in
/// the same order with identical sort options.
///
/// # Examples
/// ```
/// // [A ASC, B DESC].is_prefix([A ASC]) -> true
/// // [A ASC, B DESC].is_prefix([A DESC]) -> false (different sort
direction)
/// // [A ASC].is_prefix([A ASC, B DESC]) -> false (other is longer)
/// ```
pub fn is_prefix(&self, other: &LexOrdering) -> bool {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]