Remove initial $ PathSegment from JsonScalarExpression/JsonQueryExpression #30747
Labels
area-json
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
Milestone
In JsonScalarExpression and JsonQueryExpression, we currently have an initial
$
path segment. While JSONPATH expressions do indeed start with $, that's a specific detail of JSONPATH, and therefore SQL generation; the expression itself shouldn't contain it. For example, PostgreSQL doesn't use JSONPATH at all to drill into JSON documents, and SQLite has a simplified non-JSONPATH syntax when there's only one path segment (e.g. `JsonColumn ->> 'foo').In addition, we shouldn't produce empty Json{Scalar,Query}Expression (which we then ignore in SQL generation). The code creating these expressions should simply not create them when there's no path.
See #30745 (comment)
The text was updated successfully, but these errors were encountered: