-DATASET CSV empty

--

-CASE JsonCastTest
-LOAD_DYNAMIC_EXTENSION json
-STATEMENT return cast ('{"duck": 42}' as json)
---- 1
{"duck": 42}

-STATEMENT return cast(cast ('2023-11-14' as DATE) as json);
---- 1
"2023-11-14"

-STATEMENT return cast(cast ('"{\"duck\": 42}"' as json) as STRING);
---- error
Conversion exception: Cannot convert "{"duck": 42}" to JSON.

-STATEMENT return cast(cast ('"{\\"duck\\": 42}"' as json) as STRING);
---- 1
"{\"duck\": 42}"

-STATEMENT return cast (4 as json);
---- 1
4


-STATEMENT return cast ('4' as json);
---- 1
4

-STATEMENT return cast(cast ('{"duck": 42}' as json) as struct(duck int64));
---- 1
{duck: 42}

-STATEMENT RETURN cast('{"int_array":[42,999,null,null,-42]}' as json);
---- 1
{"int_array":[42,999,null,null,-42]}

-STATEMENT RETURN cast(cast('{"int_array":[42,999,null,null,-42]}' as json) as struct (int_array INT64[]));
---- 1
{int_array: [42,999,,,-42]}


-STATEMENT return cast(cast(
    '{
        "float":3.4028235e+38
    }'
as json) as STRUCT(float DOUBLE));
---- 1
{float: 340282349999999991754788743781432688640.000000}

-STATEMENT return cast(cast(
    '{"uuid":"ffffffff-ffff-ffff-ffff-ffffffffffff"}'
as json) as STRUCT(uuid UUID));
---- 1
{uuid: ffffffff-ffff-ffff-ffff-ffffffffffff}

-STATEMENT return cast(cast(
    '{
        "timestamp":"2047-01-10 04:00:54.775806"
    }'
as json) as STRUCT(timestamp TIMESTAMP));
---- 1
{timestamp: 2047-01-10 04:00:54.775806}

-STATEMENT return cast(cast(
    '{
        "bool": false
    }'
as json) as STRUCT(bool BOOL));
---- 1
{bool: False}

-STATEMENT return cast(cast(
    '{
        "date":"2047-01-10"
    }'
as json) as STRUCT(date DATE));
---- 1
{date: 2047-01-10}

-STATEMENT return cast(cast(
    '{
        "interval":"83 years 3 months 999 days 00:16:39.999999"
    }'
as json) as STRUCT(interval INTERVAL));
---- 1
{interval: 83 years 3 months 999 days 00:16:39.999999}

-STATEMENT RETURN typeof(cast('{"name": "Alicia", "age": 28}' AS JSON));
---- 1
json

-STATEMENT RETURN cast(null as json);
---- 1

