You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Muhammad Gelbana (JIRA)" <ji...@apache.org> on 2017/08/07 16:48:00 UTC

[jira] [Issue Comment Deleted] (DRILL-1937) Throw exception and give error message when Non-scalar sub-query used in an expression

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

Muhammad Gelbana updated DRILL-1937:
------------------------------------
    Comment: was deleted

(was: What's the problem with supporting non-scalar sub-queries ? If a sub-query returns multiple rows, the result set can be grown to include the single value, joined with all the values returned from the scalar sub-query.

For example:
{code:sql}SELECT COL1, (SELECT COL2 FROM T2) FROM T1{code}

Would output the following resultset
{noformat}
[COL1]    , [COL2]
Col1-Value, Col2-Value1
Col1-Value, Col2-Value2
Col1-Value, Col2-Value3
Col1-Value, Col2-Value4
{noformat}

Note that Col1 is the same for all rows, the column with the changing value, is the one returned from Col2.)

> Throw exception and give error message when Non-scalar sub-query used in an expression
> --------------------------------------------------------------------------------------
>
>                 Key: DRILL-1937
>                 URL: https://issues.apache.org/jira/browse/DRILL-1937
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: SQL Parser
>    Affects Versions: 0.8.0
>            Reporter: Victoria Markman
>            Assignee: Aman Sinha
>             Fix For: 0.8.0
>
>         Attachments: DRILL-1937.1.patch
>
>
> {code}
> #Fri Jan 02 21:20:47 EST 2015
> git.commit.id.abbrev=b491cdb
> {code}
> It is dangerous to have an internal function be exposed to users.
> What if one day user decided to write a UDF with the same signature ?
> {code}
> 0: jdbc:drill:schema=dfs> select SINGLE_VALUE(1) from `t.json`;
> +--+
> |  |
> +--+
> +--+
> No rows selected (0.111 seconds)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)