MCPcopy Create free account
hub / github.com/apache/datafusion / plan_window

Method plan_window

datafusion/functions-window/src/planner.rs:33–126  ·  view source on GitHub ↗
(
        &self,
        raw_expr: RawWindowExpr,
    )

Source from the content-addressed store, hash-verified

31
32impl ExprPlanner for WindowFunctionPlanner {
33 fn plan_window(
34 &self,
35 raw_expr: RawWindowExpr,
36 ) -> Result<PlannerResult<RawWindowExpr>> {
37 let RawWindowExpr {
38 func_def,
39 args,
40 partition_by,
41 order_by,
42 window_frame,
43 filter,
44 null_treatment,
45 distinct,
46 } = raw_expr;
47
48 let origin_expr = Expr::from(WindowFunction {
49 fun: func_def,
50 params: WindowFunctionParams {
51 args,
52 partition_by,
53 order_by,
54 window_frame,
55 filter,
56 null_treatment,
57 distinct,
58 },
59 });
60
61 let saved_name = NamePreserver::new_for_projection().save(&origin_expr);
62
63 let Expr::WindowFunction(window_fun) = origin_expr else {
64 unreachable!("")
65 };
66 let WindowFunction {
67 fun,
68 params:
69 WindowFunctionParams {
70 args,
71 partition_by,
72 order_by,
73 window_frame,
74 null_treatment,
75 distinct,
76 filter,
77 },
78 } = *window_fun;
79 let raw_expr = RawWindowExpr {
80 func_def: fun,
81 args,
82 partition_by,
83 order_by,
84 window_frame,
85 filter,
86 null_treatment,
87 distinct,
88 };
89
90 // TODO: remove the next line after `Expr::Wildcard` is removed

Callers

nothing calls this directly

Calls 5

restoreMethod · 0.80
saveMethod · 0.45
nameMethod · 0.45
lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected