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
