You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "benj (Jira)" <ji...@apache.org> on 2019/09/13 15:31:00 UTC

[jira] [Created] (DRILL-7375) composite type map cast/convert_to

benj created DRILL-7375:
---------------------------

             Summary: composite type map cast/convert_to
                 Key: DRILL-7375
                 URL: https://issues.apache.org/jira/browse/DRILL-7375
             Project: Apache Drill
          Issue Type: Wish
          Components: Functions - Drill
    Affects Versions: 1.16.0
            Reporter: benj


As it possible to cast varchar to map (JSON) with convert_from
{code:sql}
SELECT a, typeof(a) from (SELECT CONVERT_FROM('{a : 100, b: 200}' ,'JSON') a);
+-------------------+--------+
|         a         | EXPR$1 |
+-------------------+--------+
| {"a":100,"b":200} | MAP    |
+-------------------+--------+
{code}

It will be very usefull to have the capacity to "cast" the _MAP_ into VARCHAR with a "cast syntax" or with a "convert_to" possibility

Please note that these possibility of course exists in other database systems (example postgres : _SELECT '{"a":100,"b":200}'::json::text_)



--
This message was sent by Atlassian Jira
(v8.3.2#803003)