[ 
https://issues.apache.org/jira/browse/DRILL-2906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14529331#comment-14529331
 ] 

Steven Phillips commented on DRILL-2906:
----------------------------------------

This seems to be a problem with reading extended json, and is not related to 
the writer.

For example, here are two files, where a.json uses extended json, but b.json 
does not:
 {code}
$ cat /tmp/a.json
{
  "int_col" : {"$numberLong": 1},
  "date_col" : {"$dateDay": "2012-05-22"},
  "time_col"  : {"$time": "19:20:30.45Z"}
}
$ cat /tmp/b.json
{
  "int_col" : 1,
  "date_col" : "2012-05-22",
  "time_col"  : "19:20:30.45Z"
}
{code}

Here is the output when querying:

{code}
0: jdbc:drill:> select * from dfs.tmp.`a.json`;
+------------+------------+------------+------------+
|  int_col   |  date_col  |  time_col  |     *      |
+------------+------------+------------+------------+
| 1          | 2012-05-22 | 11:20:30.450 | null       |
+------------+------------+------------+------------+
1 row selected (1.477 seconds)
0: jdbc:drill:> select * from dfs.tmp.`b.json`;
+------------+------------+------------+
|  int_col   |  date_col  |  time_col  |
+------------+------------+------------+
| 1          | 2012-05-22 | 19:20:30.45Z |
+------------+------------+------------+
1 row selected (0.222 seconds)
{code}

> CTAS with store.format = 'json' returns incorrect results
> ---------------------------------------------------------
>
>                 Key: DRILL-2906
>                 URL: https://issues.apache.org/jira/browse/DRILL-2906
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - JSON, Storage - Writer
>            Reporter: Mehant Baid
>            Assignee: Steven Phillips
>             Fix For: 1.0.0
>
>
> Performing a CTAS with 'store.format' = 'json' and querying the table results 
> in projecting an addition field '*' will null values. Below is a simple repro
> 0: jdbc:drill:zk=local> create table t as select timestamp '1980-10-01 
> 00:00:00' from cp.`employee.json` limit 1;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.314 seconds)
> 0: jdbc:drill:zk=local> select * from t;
> +------------+------------+
> |   EXPR$0   |     *      |
> +------------+------------+
> | 1980-10-01 00:00:00.0 | null       |
> +------------+------------+
> Notice in the above result set we get an extra column '*' with null value.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to