drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hanifi Gunes (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-1295) Select returns null for non pivot fields with a nested select
Date Wed, 13 Aug 2014 18:48:19 GMT

     [ https://issues.apache.org/jira/browse/DRILL-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hanifi Gunes updated DRILL-1295:
--------------------------------

    Description: 
Take two simple csv files:

t1.csv:
ID,Name,Lastname
9711942,name0,last0
9707867,name1,last1

t2.csv
ID,Case Number
9711942,HX362083
9707867,HX357851

The following queries return:
select columns[0], columns[1], columns[2]
FROM dfs.`/path/to/t1.csv`;
+------------+------------+------------+
| ID         | Name       | Lastname   |
| 9711942    | name0      | last0      |
| 9707867    | name1      | last1      |
+------------+------------+------------+

SELECT columns[0], columns[1] FROM dfs.`/path/to/t2.csv`;
+------------+------------+
| ID         | Case Number |
| 9711942    | HX362083   |
| 9707867    | HX357851   |
+------------+------------+

This one returns all the fields null except the pivot field
select columns[0], columns[1], columns[2]
FROM dfs.`/path/to/t1.csv` 
where columns[0] in 
(SELECT columns[0] FROM dfs.`/path/to/t2.csv`);

+------------+------------+------------+
| ID         | null       | null       |
| 9711942    | null       | null       |
| 9707867    | null       | null       |
+------------+------------+------------+


  was:
Take two simple csv files:

t1.csv:
ID,Name,Lastname
9711942,name0,last0
9707867,name1,last1

t2.csv
ID,Case Number
9711942,HX362083
9707867,HX357851

The following queries return:
select columns[0], columns[1], columns[2]
FROM dfs.`/path/to/t1.csv`;
+------------+------------+------------+
| ID         | Name       | Lastname   |
| 9711942    | name0      | last0      |
| 9707867    | name1      | last1      |
+------------+------------+------------+

SELECT columns[0] FROM dfs.`/path/to/t2.csv`;
+------------+
| ["ID","Name","Lastname"] |
| ["9711942","name0","last0"] |
| ["9707867","name1","last1"] |
+------------+

This one returns all the fields null except the pivot field
select columns[0], columns[1], columns[2]
FROM dfs.`/path/to/t1.csv` 
where columns[0] in 
(SELECT columns[0] FROM dfs.`/path/to/t2.csv`);

+------------+------------+------------+
| ID         | null       | null       |
| 9711942    | null       | null       |
| 9707867    | null       | null       |
+------------+------------+------------+



> Select returns null for non pivot fields with a nested select
> -------------------------------------------------------------
>
>                 Key: DRILL-1295
>                 URL: https://issues.apache.org/jira/browse/DRILL-1295
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>            Reporter: Hanifi Gunes
>
> Take two simple csv files:
> t1.csv:
> ID,Name,Lastname
> 9711942,name0,last0
> 9707867,name1,last1
> t2.csv
> ID,Case Number
> 9711942,HX362083
> 9707867,HX357851
> The following queries return:
> select columns[0], columns[1], columns[2]
> FROM dfs.`/path/to/t1.csv`;
> +------------+------------+------------+
> | ID         | Name       | Lastname   |
> | 9711942    | name0      | last0      |
> | 9707867    | name1      | last1      |
> +------------+------------+------------+
> SELECT columns[0], columns[1] FROM dfs.`/path/to/t2.csv`;
> +------------+------------+
> | ID         | Case Number |
> | 9711942    | HX362083   |
> | 9707867    | HX357851   |
> +------------+------------+
> This one returns all the fields null except the pivot field
> select columns[0], columns[1], columns[2]
> FROM dfs.`/path/to/t1.csv` 
> where columns[0] in 
> (SELECT columns[0] FROM dfs.`/path/to/t2.csv`);
> +------------+------------+------------+
> | ID         | null       | null       |
> | 9711942    | null       | null       |
> | 9707867    | null       | null       |
> +------------+------------+------------+



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message