Skip to content

Commit

Permalink
add better docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Jul 2, 2024
1 parent d75d8e2 commit c629076
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ impl FunctionRewrite for JsonFunctionRewriter {
}
}

/// This replaces `get_json(foo, bar)::int` with `json_get_int(foo, bar)` so the JSON function can take care of
/// extracting the right value type from JSON without the need to materialize the JSON union.
fn optimise_json_get_cast(cast: &Cast) -> Option<Transformed<Expr>> {
let Expr::ScalarFunction(scalar_func) = &*cast.expr else {
return None;
Expand Down Expand Up @@ -76,6 +78,7 @@ fn unnest_json_calls(func: &ScalarFunction) -> Option<Transformed<Expr>> {
}
}

/// Implement a custom SQL planner to replace postgres JSON operators with custom UDFs
#[derive(Debug, Default)]
pub struct JsonSQLPlanner;

Expand Down

0 comments on commit c629076

Please sign in to comment.