You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: parse JsonAccess as a custom binary operator
- Needed in datafusion-contrib/datafusion-variant#26
- `sqlparser-rs` currently exposes the colon operator (`:`) as a
special `JsonAccess` expression. So it fails in datafusion's parsing
before an `ExprPlanner` is even invoked.
- Fix it by converting `JsonAccess` to a normal binary expr, on which
the `ExprPlanner` is invoked and custom parsing can be done.
I have arrived at this solution iteratively to solve
datafusion-contrib/datafusion-variant#26.
Some alternatives I considered (but NOT IMPLEMENTED):
- Add a new `Expr::JsonAccess` instead of re-using `BinaryExpr`.
Alongside this, we could also introduce datafusion's version of
a `JsonPath` struct. `Expr::JsonAccess` could also contain the
optional cast that usually comes after it (like in
`col_a:field_b::int`). The cast might be needed for performance
optimizations. This is a much bigger change, so I have not done it.
0 commit comments