Skip to content

Commit 95771da

Browse files
authored
Minor: Add upgrade guide for Expr::WindowFunction (#16313)
1 parent 1daa5ed commit 95771da

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

docs/source/library-user-guide/upgrading.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,60 @@
2121

2222
## DataFusion `48.0.0`
2323

24+
### `Expr::WindowFunction` is now `Box`ed
25+
26+
`Expr::WindowFunction` is now a `Box<WindowFunction>` instead of a `WindowFunction` directly.
27+
This change was made to reduce the size of `Expr` and improve performance when
28+
planning queries (see [details on #16207]).
29+
30+
This is a breaking change, so you will need to update your code if you match
31+
on `Expr::WindowFunction` directly. For example, if you have code like this:
32+
33+
```rust
34+
# /* comment to avoid running
35+
match expr {
36+
Expr::WindowFunction(WindowFunction {
37+
params:
38+
WindowFunctionParams {
39+
partition_by,
40+
order_by,
41+
..
42+
}
43+
}) => {
44+
// Use partition_by and order_by as needed
45+
}
46+
_ => {
47+
// other expr
48+
}
49+
}
50+
# */
51+
```
52+
53+
You will need to change it to:
54+
55+
```rust
56+
# /* comment to avoid running
57+
match expr {
58+
Expr::WindowFunction(window_fun) => {
59+
let WindowFunction {
60+
fun,
61+
params: WindowFunctionParams {
62+
args,
63+
partition_by,
64+
..
65+
},
66+
} = window_fun.as_ref();
67+
// Use partition_by and order_by as needed
68+
}
69+
_ => {
70+
// other expr
71+
}
72+
}
73+
# */
74+
```
75+
76+
[details on #16207]: https://github.com/apache/datafusion/pull/16207#issuecomment-2922659103
77+
2478
### The `VARCHAR` SQL type is now represented as `Utf8View` in Arrow.
2579

2680
The mapping of the SQL `VARCHAR` type has been changed from `Utf8` to `Utf8View`

0 commit comments

Comments
 (0)