Skip to content

colon : operator - initial implementation #26

Closed

Description

@Samyak2

Context

Discussion started here - #2 (comment) (see next few comments too).

The colon operator is a shorthand for variant_get. For example, variant_get(column, '$.field', 'int') can be written as column:field::int. The part after the colon is a JSON path.

Implementation

References

Activity

  1. Samyak2 commented on Jan 16, 2026

    @Samyak2
    ContributorAuthor
  2. sdf-jkl commented on Feb 27, 2026

    @sdf-jkl
    Collaborator

    Hi @Samyak2, how should we proceed with the next step?

  3. Samyak2 commented on Feb 28, 2026

    @Samyak2
    ContributorAuthor

    The next step would be to use ExprPlanner to recognize the colon syntax. I'm working on that.
    The blocker here is that datafusion v52 still uses an older v0.60 of datafusion-sqlparser-rs (which doesn't include apache/datafusion-sqlparser-rs#2124). The update was done recently (in apache/datafusion#20177) and should be available in the next v53 release of datafusion.

  4. sdf-jkl commented on Feb 28, 2026

    @sdf-jkl
    Collaborator

    Thanks! Let's wait for the v53 release.

  5. Samyak2 commented on Mar 1, 2026

    @Samyak2
    ContributorAuthor

    I tried using ExprPlanner from datafusion main to convert colon op to variant_get - #31

    But I ran into a problem. sqlparser-rs exposes colon operator as a special JsonAccess method, not as a simple binary expr. I had to convert it in datafusion so that an ExprPlanner can intercept it. Please take a look: apache/datafusion#20628

  6. added a commit that references this issue on Mar 30, 2026
    1203b50
  7. added a commit that references this issue on Sep 30, 2026
    0b58831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions