Details
-
Bug
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
1.8.0
-
None
-
None
Description
In the Drill docs:
SQL REFERENCE -> SQL FUNCTIONS -> DATA TYPE CONVERSION
The output for the example shown for convert_from() with a map into JSON is wrong:
------------------------- BEGIN EXCERPT ---------------------------------------------------------------------
This example uses a map as input to return a repeated list vector (JSON).
SELECT CONVERT_FROM('[
{a : 100, b: 200},
{a:300, b: 400}]' ,'JSON') AS MYCOL1 FROM (VALUES(1));
--------------------
MYCOL1 |
--------------------
[[1,2],[3,4],[5]] |
--------------------
1 row selected (0.141 seconds)
------------------------- END ----------------------------------------------
The correct output should be:
---------------------------------------
SELECT CONVERT_FROM('[
,
{a:300, b: 400}]' ,'JSON') AS MYCOL1 FROM (VALUES(1));
----------------------------------------
MYCOL1 |
----------------------------------------
[{"a":100,"b":200},{"a":300,"b":400}] |
----------------------------------------
1 row selected (2.618 seconds)
The error probably resulted from copying the output of the previous example.