You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/12/03 00:45:00 UTC

[jira] [Created] (CALCITE-4919) Add a function to parse a JSON string into a VARIANT object

Julian Hyde created CALCITE-4919:
------------------------------------

             Summary: Add a function to parse a JSON string into a VARIANT object
                 Key: CALCITE-4919
                 URL: https://issues.apache.org/jira/browse/CALCITE-4919
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


Add a function to parse a JSON string into a VARIANT object. This assumes that the VARIANT type (described in CALCITE-4918) has already been implemented.

The email thread [Snowflake JSON support|https://www.mail-archive.com/dev@calcite.apache.org/msg17417.html] describes 4 independent tasks:
 # Support for the ‘:’ (field reference) operator in the parser. We already have ‘::’ (Postgres-style cast) in the Babel parser. We’d have to check that ‘:’ does not introduce ambiguities
 # Add a {{VARIANT}} datatype. This is similar to SQL Server’s {{VARIANT}} type and Java’s {{Object}} type in that it is a tagged union: it can be many sub-types, and you can check the type at runtime using operators such as {{{}TYPEOF{}}}.
 # We already have the {{ITEM}} operator (written using '[ ]') that works on arrays and maps. We should make {{ITEM}} also work on {{{}VARIANT{}}}.
 # Add a function to parse a JSON string to a {{VARIANT}} object.

This case is task 4 on the list. Task 2 is CALCITE-4918. As the email notes, the tasks are fairly independent. You could do 2, 3, 4 without 1, and do 1 without 2, 3, 4.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)