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

Julian Hyde edited comment on PHOENIX-2767 at 3/14/16 11:37 PM:
----------------------------------------------------------------

If I recall correctly, the standard says that 'x in (a, b, c)' expands to 'x = 
a or x = b or x = c', and Oracle does the same. For example:

{noformat}
SQL> select empno, ename, mgr from emp where 7782 in (empno, mgr);

     EMPNO ENAME             MGR
---------- ---------- ----------
      7782 CLARK            7839
      7934 MILLER           7782
{noformat}

I checked, and Calcite executes this query correctly.

Moving to Phoenix.


was (Author: julianhyde):
If I recall correctly, the standard says that 'x in (a, b, c)' expands to 'x = 
a or x = b or x = c', and Oracle does the same. For example:

{noformat}
SQL> select empno, ename, mgr from emp where 7782 in (empno, mgr);

     EMPNO ENAME             MGR
---------- ---------- ----------
      7782 CLARK            7839
      7934 MILLER           7782
{noformat}

> Support columns for IN list
> ---------------------------
>
>                 Key: PHOENIX-2767
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2767
>             Project: Phoenix
>          Issue Type: Improvement
>         Environment: HDP 2.3.4 with Phoenix 4.4.0 on Calcite 1.5; also 
> Phoenix 4.6.0 on Calcite 1.3
>            Reporter: Kevin Liew
>            Assignee: Julian Hyde
>            Priority: Minor
>              Labels: avatica, calcite, function
>
> {code:sql}select e.first_name from emp e, addr a where e.first_name in 
> (a.first_name){code}
> {code}8org.apache.calcite.avatica.proto.Responses$ErrorResponseÆ
> ëjava.lang.RuntimeException: java.sql.SQLException: ERROR 214 (22008): 
> Values in IN must evaluate to a constant.
>       at org.apache.calcite.avatica.jdbc.JdbcMeta.propagate(JdbcMeta.java:645)
>       at org.apache.calcite.avatica.jdbc.JdbcMeta.prepare(JdbcMeta.java:671)
>       at 
> org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:177)
>       at 
> org.apache.calcite.avatica.remote.Service$PrepareRequest.accept(Service.java:1401)
>       at 
> org.apache.calcite.avatica.remote.Service$PrepareRequest.accept(Service.java:1379)
>       at 
> org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:102)
>       at 
> org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:38)
>       at 
> org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:68)
>       at 
> org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52){code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to