[
https://issues.apache.org/jira/browse/DRILL-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16982491#comment-16982491
]
benj commented on DRILL-1755:
-
This problems seems partially OK,
With a file containing the previous description {noformat}[{"accessLevel":
"public"},{"accessLevel": "private"}]{noformat}
{code:sql}
apache drill (1.16)> SELECT *, 'justfortest' AS mytext FROM
dfs.tmp.`example.json`;
+-+-+
| accessLevel | mytext|
+-+-+
| public | justfortest |
| private | justfortest |
+-+-+
2 rows selected (0.127 seconds)
{code}
But some problems subsists, like
{code:sql}
apache drill (1.16)> SELECT 'justfortest' As mytext FROM dfs.tmp.`example.json`;
Error: DATA_READ ERROR: Error parsing JSON - Cannot read from the middle of a
record. Current token was START_ARRAY
File /tmp/example.json
Record 1
Column 2
Fragment 0:0
{code}
> Add support for arrays and scalars as first level elements in JSON files
>
>
> Key: DRILL-1755
> URL: https://issues.apache.org/jira/browse/DRILL-1755
> Project: Apache Drill
> Issue Type: Improvement
>Reporter: Abhishek Girish
>Priority: Major
> Fix For: Future
>
> Attachments: drillbit.log
>
>
> Publicly available JSON data sometimes have the following structure (arrays
> as first level elements):
> [
> {"accessLevel": "public"
> },
> {"accessLevel": "private"
> }
> ]
> Drill currently does not support Arrays or Scalars as first level elements.
> Only maps are supported. We should add support for the arrays and scalars.
> Log attached.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)