Skip to content

Commit ed1eeb6

Browse files
committed
wip
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 8e60cd4 commit ed1eeb6

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

vortex-array/src/expr/analysis/labeling.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,18 @@ use crate::expr::traversal::TraversalOrder;
1818
///
1919
/// The labeling process:
2020
/// - First, `label_edge` is called on the node to produce its self-label
21-
/// - Then, for each child, `merge_child` is called with `(accumulator, child_label)`
22-
/// to fold the child label into the accumulator, starting with the self-label
21+
/// - Then, for each child, `merge_child` is called with `(self_label, child_label)`
22+
/// to fold the child label into the self_label
2323
/// - This produces the final label for the node
2424
///
25-
/// This approach avoids allocating a Vec for child labels by processing them one at a time.
26-
///
2725
/// # Parameters
2826
///
2927
/// - `expr`: The root expression to label
3028
/// - `label_edge`: Function that computes a label for a single node
3129
/// - `merge_child`: Mutable function that folds child labels into an accumulator.
32-
/// Takes `(accumulator, child_label)` and returns the updated accumulator.
30+
/// Takes `(self_label, child_label)` and returns the updated accumulator.
3331
/// Called once per child, with the initial accumulator being the node's self-label.
3432
///
35-
/// # Examples
36-
///
37-
/// ```ignore
38-
/// // Count depth of each subtree
39-
/// let depths = label_tree(
40-
/// expr,
41-
/// |_node| 1, // Each node has depth 1 by itself
42-
/// |self_depth, child_depth| self_depth.max(*child_depth + 1)
43-
/// );
44-
/// ```
45-
///
46-
/// ```ignore
47-
/// // Check if any node in subtree is null-sensitive
48-
/// let sensitive = label_tree(
49-
/// expr,
50-
/// |node| node.is_null_sensitive(),
51-
/// |acc, child| acc || *child // OR all children with self
52-
/// );
53-
/// ```
5433
pub fn label_tree<L: Clone>(
5534
expr: &Expression,
5635
label_edge: impl Fn(&Expression) -> L,

vortex-array/src/expr/analysis/null_sensitive.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ mod tests {
3030

3131
#[test]
3232
fn test_null_sensitive_with_is_null() {
33-
// Expression: is_null($.col1)
3433
let expr = is_null(col("col1"));
3534
let labels = label_null_sensitive(&expr);
3635

@@ -40,7 +39,6 @@ mod tests {
4039

4140
#[test]
4241
fn test_null_sensitive_without_is_null() {
43-
// Expression: $.col1 = 5
4442
let expr = eq(col("col1"), lit(5));
4543
let labels = label_null_sensitive(&expr);
4644

@@ -50,7 +48,6 @@ mod tests {
5048

5149
#[test]
5250
fn test_null_sensitive_nested() {
53-
// Expression: ($.col1 = 5) = is_null($.col2)
5451
let left = eq(col("col1"), lit(5));
5552
let right = is_null(col("col2"));
5653
let expr = eq(left.clone(), right.clone());

0 commit comments

Comments
 (0)