peter-toth commented on issue #9457:
URL:
https://github.com/apache/arrow-datafusion/issues/9457#issuecomment-1978364210
I was thinking of a macro that accepts a sequence of expressions and their
transformations:
```
let t = transform_siblings!(
expr, |e| transform_option_box(e, &mut f),
when_then_expr, |wte| wte.into_iter().map_until_stop_and_collect(|(when,
then)| {
transform_siblings!(
when, |w| transform_box(w, &mut f),
then, |t| transform_box(t, &mut f),
),
}),
else_expr, |ee| transform_option_box(ee, &mut f)
)
t.update_data(|(new_expr, new_when_then_expr, new_else_expr)| {
Expr::Case(Case::new(new_expr, new_when_then_expr, new_else_expr))
})
```
Inside the macro we can build up the same `update_data` +
`try_transform_node ` chain or maybe avoid that to make it easier to debug.
--
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]