[
https://issues.apache.org/jira/browse/DRILL-3540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14637873#comment-14637873
]
Jacques Nadeau commented on DRILL-3540:
---------------------------------------
A short term solution may be to add JDBC support for using the convert to JSON
functionality that the ODBC driver uses. We could then add to default
connection strings so that SQLLine isn't calling tostring on a complex object.
> SQLline calls toString to convert complex columns into JSON. This
> translation doesn't work for some types
> ----------------------------------------------------------------------------------------------------------
>
> Key: DRILL-3540
> URL: https://issues.apache.org/jira/browse/DRILL-3540
> Project: Apache Drill
> Issue Type: Bug
> Components: Client - JDBC
> Affects Versions: 1.1.0
> Reporter: Stefán Baxter
> Assignee: Steven Phillips
>
> test-datetime.json
> {
> "occurred_at" : {
> "$date" : "2015-04-01T00:14:02.309Z"
> },
> "sub":{
> "occurred_at":{"$date":"2015-04-01T00:14:02.309Z"}
> }
> }
> correctly results in this (without timezone though):
> select t.occurred_at, t.sub.occurred_at from dfs.tmp.`/test-datetime.json`
> as t;
> +--------------------------+--------------------------+
> | occurred_at | EXPR$1 |
> +--------------------------+--------------------------+
> | 2015-04-01 00:14:02.309 | 2015-04-01 00:14:02.309 |
> +--------------------------+--------------------------+
> 1 row selected (0.067 seconds)
> here we select the substructure, not the field
> select t.occurred_at, t.sub from dfs.tmp.`/test-datetime.json` as t;
> incorrectly results in this:
> +-------------+-----+
> | occurred_at | sub |
> +-------------+-----+
> | 2015-04-01 00:14:02.309 |
> {"occurred_at":{"year":2015,"dayOfMonth":1,"dayOfWeek":3,"era":1,"dayOfYear":91,"weekyear":2015,"weekOfWeekyear":14,"monthOfYear":4,"yearOfEra":2015,"yearOfCentury":15,"centuryOfEra":20,"millisOfSecond":309,"millisOfDay":842309,"secondOfMinute":2,"secondOfDay":842,"minuteOfHour":14,"minuteOfDay":14,"hourOfDay":0,"millis":1427847242309,"zone":{"fixed":false,"uncachedZone":{"cachable":true,"fixed":false,"id":"Atlantic/Reykjavik"},"id":"Atlantic/Reykjavik"},"chronology":{"zone":{"fixed":false,"uncachedZone":{"cachable":true,"fixed":false,"id":"Atlantic/Reykjavik"},"id":"Atlantic/Reykjavik"}},"afterNow":false,"beforeNow":true,"equalNow":false}}
> |
> +-------------+-----+
> 1 row selected (0.066 seconds)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)