Vitalii Diravka created DRILL-6774:
--------------------------------------

             Summary: Wrong data types of empty batches schema for queries with 
aliases
                 Key: DRILL-6774
                 URL: https://issues.apache.org/jira/browse/DRILL-6774
             Project: Apache Drill
          Issue Type: Bug
            Reporter: Vitalii Diravka


{code:java}
0: jdbc:drill:zk=local> select name as full_name from (select CAST(Product AS 
VARCHAR) AS name from dfs.`/tmp/empty.json`);
+------------+
| full_name  |
+------------+
+------------+
No rows selected (0.177 seconds)
{code}
The data type for above query is INT:OPTIONAL, but should be VARCHAR:OPTIONAL.
 It can be verified only via Drill unit test framework or via usage of UNION 
ALL operator with other query:

The usual result:
{code:java}
0: jdbc:drill:zk=local> SELECT full_name FROM cp.`employee.json` LIMIT 2;
+------------------+
|    full_name     |
+------------------+
| Sheri Nowmer     |
| Derrick Whelply  |
+------------------+
2 rows selected (0.207 seconds)
{code}
But after UNION ALL with the above empty output:
{code:java}
0: jdbc:drill:zk=local> select name as full_name from (select CAST(Product AS 
VARCHAR) AS name from dfs.`/tmp/empty.json`) UNION ALL SELECT full_name FROM 
cp.`employee.json` LIMIT 2;
+------------+
| full_name  |
+------------+
| null       |
| null       |
+------------+
2 rows selected (0.198 seconds)
{code}
Perhaps it is a regression of DRILL-5546 and the solution could be similar to 
DRILL-6773



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to