drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aman Sinha (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5556) Drill allows "SELECT *, *" query
Date Tue, 30 May 2017 00:33:04 GMT

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

Aman Sinha commented on DRILL-5556:
-----------------------------------

I am not sure if it is an invalid SQL.  Postgres certainly allows it: 

{noformat}
tpcds=# select * from tt1 ;
 a1 | b1 
----+----
 10 | 20
(1 row)

tpcds=# select *, * from tt1 ;
 a1 | b1 | a1 | b1 
----+----+----+----
 10 | 20 | 10 | 20
(1 row)
{noformat}

Only when you reference the columns in some way, e.g from an outer query block then it will
given an error: 
{noformat}
tpcds=# select a1 from (select *, * from tt1) as d;
ERROR:  column reference "a1" is ambiguous
LINE 1: select a1 from (select *, * from tt1) as d;
{noformat}


> Drill allows "SELECT *, *" query
> --------------------------------
>
>                 Key: DRILL-5556
>                 URL: https://issues.apache.org/jira/browse/DRILL-5556
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.10.0
>            Reporter: Paul Rogers
>            Priority: Minor
>
> Configure the CSV storage plugin to not read the header row. Create a simple CSV file:
> {code}
> 10,foo,bar
> {code}
> Issue the following nonsensical query:
> {code}
> SELECT *, * FROM `dfs.data`.`example.csv`
> {code}
> Get the following results:
> {code}
> columns,columns0
> ["10","foo","bar"],["10","foo","bar"]
> {code}
> Expected an error as using two unqualified *'s is not valid SQL.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message