[
https://issues.apache.org/jira/browse/DRILL-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13951159#comment-13951159
]
Steven Phillips commented on DRILL-409:
---------------------------------------
I'm not sure if this was fixed by some other check in, but I am not able to
reproduce this problem:
$ cat /tmp/names.json
{
"first" : "Steven",
"last" : "Phillips"
}
0: jdbc:drill:zk=local> select * from dfs.`/tmp/names.json`;
+------------+------------+
| first | last |
+------------+------------+
| Steven | Phillips |
+------------+------------+
1 row selected (0.11 seconds)
0: jdbc:drill:zk=local> select first from dfs.`/tmp/names.json`;
+------------+
| FIRST |
+------------+
| Steven |
+------------+
1 row selected (0.107 seconds)
0: jdbc:drill:zk=local> select last from dfs.`/tmp/names.json`;
+------------+
| LAST |
+------------+
| Phillips |
+------------+
1 row selected (0.098 seconds)
> JSON Column names such as first ,last not returning data- NULL
> --------------------------------------------------------------
>
> Key: DRILL-409
> URL: https://issues.apache.org/jira/browse/DRILL-409
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Ramana Inukonda Nagaraj
>
> Assume the json file has columns/fields like
> 0: jdbc:drill:schema=dfs> select * from
> dfs.`/user/root/employeeNestedObject.json`;
> +------------+------------+------------+------------+------------+------------+------------+-----------------+------------------+----------------+
> | first | last | age | sex | salary | wealth
> | registered | favorites.color | favorites.number | favorites.food |
> +------------+------------+------------+------------+------------+------------+------------+-----------------+------------------+----------------+
> | John | Doe | 39 | M | 2147483647 |
> 1.7976931E30 | true | Blue | 13 | Spaghetti
> |
> +------------+------------+------------+------------+------------+------------+------------+-----------------+------------------+----------------+
> Querying the 'first' column name returns null. Seems to be a reserved word/
> function
> 0: jdbc:drill:schema=dfs> select first from
> dfs.`/user/root/employeeNestedObject.json`;
> +------------+
> | FIRST |
> +------------+
> | null |
> However if the name is changed to firstName it works fine
> 0: jdbc:drill:schema=dfs> select firstName from
> dfs.`/user/root/employeeNestedObject.json`;
> +------------+
> | firstName |
> +------------+
> | John |
> +------------+
> 1 row selected (0.082 seconds)
> Same for last.
--
This message was sent by Atlassian JIRA
(v6.2#6252)