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
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 ascolumn:field::int. The part after the colon is a JSON path.Implementation
:as an operator.snowflakedialect ofdatafusion-sqlparser-rs, but datafusion uses thegenericdialect.JsonAccessfrom sqlparser-rs as a binary expr: feat: parseJsonAccessas a binary operator, addOperator::Colonapache/datafusion#20628ExprPlannerto allow:as a custom operator from this crate. See: epic: Initial implementation of this crate #2 (comment)variant_get.References
:- https://docs.databricks.com/aws/en/sql/language-manual/functions/colonsign (note: their colon works on JSON strings too, but we would be focusing on variant in this case)