drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Khurram Faraaz <kfar...@maprtech.com>
Subject Re: Last Column showing blank in csv file
Date Mon, 28 Nov 2016 10:41:21 GMT
You should set skipFirstLine to true, in the formats area of the storage
plugin configuration.
Doing the above will ensure that Drill skips the first line of your CSV
file.
And your query should look like,

0: jdbc:drill:schema=dfs.tmp> select columns[0] sepalen, columns[1]
sepalwidth, columns[2] patelen, columns[3] patelwidth, columns[4] class
. . . . . . . . . . . . . . > from dfs.tmp.`userdata.csv`;
+----------+-------------+----------+--------------+--------+
| sepalen  | sepalwidth  | patelen  |  patelwidth  | class  |
+----------+-------------+----------+--------------+--------+
| 5.1      | 3.5         | 1.4      | Iris-setosa  | 0.2    |
| 4.9      | 3           | 1.4      | Iris-setosa  | 0.2    |
| 4.7      | 3.2         | 1.3      | Iris-setosa  | 0.2    |
| 4.6      | 3.1         | 1.5      | Iris-setosa  | 0.2    |
| 5        | 3.6         | 1.4      | Iris-setosa  | 0.2    |
| 5.4      | 3.9         | 1.7      | Iris-setosa  | 0.4    |
| 4.6      | 3.4         | 1.4      | Iris-setosa  | 0.3    |
| 5        | 3.4         | 1.5      | Iris-setosa  | 0.2    |
| 4.4      | 2.9         | 1.4      | Iris-setosa  | 0.2    |
| 4.9      | 3.1         | 1.5      | Iris-setosa  | 0.1    |
| 5.4      | 3.7         | 1.5      | Iris-setosa  | 0.2    |
| 4.8      | 3.4         | 1.6      | Iris-setosa  | 0.2    |
+----------+-------------+----------+--------------+--------+
12 rows selected (0.5 seconds)

On Mon, Nov 28, 2016 at 3:59 PM, Sanjiv Kumar <ktrsanjiv@gmail.com> wrote:

> My Hello
>       I have one csv file having data:-
>
> sepalen,sepalwidth,patelen,patelwidth,class
> 5.1,3.5,1.4,Iris-setosa,0.2
> 4.9,3,1.4,Iris-setosa,0.2
> 4.7,3.2,1.3,Iris-setosa,0.2
> 4.6,3.1,1.5,Iris-setosa,0.2
> 5,3.6,1.4,Iris-setosa,0.2
> 5.4,3.9,1.7,Iris-setosa,0.4
> 4.6,3.4,1.4,Iris-setosa,0.3
> 5,3.4,1.5,Iris-setosa,0.2
> 4.4,2.9,1.4,Iris-setosa,0.2
> 4.9,3.1,1.5,Iris-setosa,0.1
> 5.4,3.7,1.5,Iris-setosa,0.2
> 4.8,3.4,1.6,Iris-setosa,0.2
>
> While Query through this file using this query:-
>
> select A.`sepalen`, A.`sepalwidth`, A.`patelen`, A.`patelwidth`, A.class
> from dfs.tmp.`copydata.csv` as A;
>
> Last Columm Data showing null. What is the problem. Is this a bug.??
>
> My Output is:-  class column showing blank.
>
>
>
>
>
>
> --
>  ......................
>   Thanks & Regards
>   *Sanjiv Kumar*
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message