[
https://issues.apache.org/jira/browse/DRILL-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14314601#comment-14314601
]
Aman Sinha commented on DRILL-1937:
-----------------------------------
Your patch is doing the check for single_value inside RewriteProjectRel which
is quite confusing. I can see that you are trying to avoid an extra visitor
traversal. Is it possible to use the UnsupportedVisitor once for all the
things we want to check from the logical plan ?
If that is not feasible, I would suggest changing the name of RewriteProjectRel
to something like PreProcessLogicalRel and add comments that this class is
doing both a rewrite and a check for unsupported operation.
The following seems incorrect because this is a function, not a RELATIONAL
operator.
"SqlUnsupportedException.ExceptionType.RELATIONAL," .....
Also, the error message should be changed to be more concise and meaningful.
For example here's what Postgres returns for non-scalar subquery: "ERROR:
more than one row returned by a subquery used as an expression".
> Disable internal function SINGLE_VALUE()
> -----------------------------------------
>
> 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.3.4#6332)