Skip to content

[branch-53] feat: parse JsonAccess as a binary operator, add Operator::Colon#20717

Merged
alamb merged 1 commit intoapache:branch-53from
Samyak2:backport-json-access
Mar 5, 2026
Merged

[branch-53] feat: parse JsonAccess as a binary operator, add Operator::Colon#20717
alamb merged 1 commit intoapache:branch-53from
Samyak2:backport-json-access

Conversation

@Samyak2
Copy link
Contributor

@Samyak2 Samyak2 commented Mar 5, 2026

Which issue does this PR close?

Rationale for this change

  • 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.
  • Add Operator::Colon. Currently it's not used/implemented in datafusion.

What changes are included in this PR?

  • Fixes the above problem by converting JsonAccess to a normal binary expr, on which the ExprPlanner is invoked and custom parsing can be done.

Are these changes tested?

Added tests.

Also did a prototype of a custom ExprPlanner in datafusion-variant using this to convert colon operator to variant_get function - datafusion-contrib/datafusion-variant#31

Are there any user-facing changes?

Add Operator::Colon

…tor::Colon` (apache#20628)

Backport of apache#20628 on v53
branch.

- Convert `JsonAccess` from sqlparser as a normal binary operator
- Add `Operator::Colon`
- Needed for datafusion-contrib/datafusion-variant#26
@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates substrait Changes to the substrait crate labels Mar 5, 2026
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Samyak2

FYI @comphead

@alamb alamb added the api change Changes the API exposed to users of the crate label Mar 5, 2026
@alamb alamb merged commit f8a03d8 into apache:branch-53 Mar 5, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates sql SQL Planner substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants