I created the Jira here: https://issues.apache.org/jira/browse/CALCITE-7448 and started discussing the approach there.
I also went ahead with a PR based on what seemed like the least invasive option: https://github.com/apache/calcite/pull/4844 At the moment, the implementation is behind a conformance hook, so the default parser behavior is unchanged. I’ll continue exploring whether full disambiguation is possible, but the first experiments suggest it would require a larger grammar change. That said, I do not have strong feelings about this particular implementation strategy, so if you have pointers or would prefer a different direction, I’d be glad to adapt. Best, Tamas On 2026/03/20 15:29:56 Julian Hyde wrote: > Now is a good time to open a Jira case. If this needs to be optional > functionality (e.g. because of conflicts with the BigQuery JSON support), you > should describe the configuration parameter(s) that would enable/disable it. > > > On Mar 20, 2026, at 5:48 AM, Tamas M. <[email protected]> wrote: > > > > Hi devs, > > > > I’m looking into adding Snowflake-style VARIANT access syntax (e.g. > > variant_col:field1.field2) to Calcite and wanted to check whether there has > > been any prior work or discussion around this. > > > > Several systems (e.g. Snowflake [3][4], Databricks [1][2]) support this > > kind of access, and with recent VARIANT support in Parquet it seems > > increasingly relevant for interoperability. > > > > From what I can tell: > > - VARIANT type support (CALCITE-4918) is available > > - JSON -> VARIANT parsing (CALCITE-4919) is still open; while focused on > > parsing, it references a broader design that includes ':'-based path access > > [5] > > - The ':' operator itself does not appear to be implemented > > > > I did a quick exploration of the parser, and it looks like introducing ':' > > may collide with existing syntax (e.g. JSON_OBJECT). > > > > I’m considering contributing this, likely as parser-level sugar, but wanted > > to check: > > - Has anyone already explored or prototyped the ':' operator? > > - Are there known concerns or prior discussions around parser ambiguities? > > > > If there is no ongoing work, I’m happy to take a first pass and open a JIRA > > / draft PR. Also happy to collaborate if others are interested. > > > > Thanks, > > Tamas > > > > References: > > [1] > > https://docs.databricks.com/en/sql/language-manual/functions/coloncolon.html > > [2] https://docs.databricks.com/en/sql/language-manual/functions/colon.html > > [3] https://docs.snowflake.com/en/sql-reference/functions/cast > > [4] https://docs.snowflake.com/en/user-guide/querying-semistructured > > [5] https://issues.apache.org/jira/browse/CALCITE-4919 > > [6] https://issues.apache.org/jira/browse/CALCITE-6255 > >
