Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Environment:

      HDP 2.3.4 with Phoenix 4.4.0 on Calcite 1.5; also Phoenix 4.6.0 on Calcite 1.3

      Description

      select e.first_name from emp e, addr a where e.first_name in (a.first_name)
      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)

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Yes, I think so.

          Show
          julianhyde Julian Hyde added a comment - Yes, I think so.
          Hide
          jamestaylor James Taylor added a comment -

          Interesting - didn't know about that syntax. Will we get that for free when we move to Calcite for parsing/planning, Julian Hyde?

          Show
          jamestaylor James Taylor added a comment - Interesting - didn't know about that syntax. Will we get that for free when we move to Calcite for parsing/planning, Julian Hyde ?
          Hide
          julianhyde Julian Hyde added a comment - - edited

          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:

          SQL> select empno, ename, mgr from emp where 7782 in (empno, mgr);
          
               EMPNO ENAME	     MGR
          ---------- ---------- ----------
                7782 CLARK	    7839
                7934 MILLER	    7782
          

          I checked, and Calcite executes this query correctly.

          Moving to Phoenix.

          Show
          julianhyde Julian Hyde added a comment - - edited 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: SQL> select empno, ename, mgr from emp where 7782 in (empno, mgr); EMPNO ENAME MGR ---------- ---------- ---------- 7782 CLARK 7839 7934 MILLER 7782 I checked, and Calcite executes this query correctly. Moving to Phoenix.
          Hide
          jamestaylor James Taylor added a comment -

          That's fine to move it to Phoenix, but it looks non standard, so unless Calcite supports it, we'd probably just close it as Never.

          Show
          jamestaylor James Taylor added a comment - That's fine to move it to Phoenix, but it looks non standard, so unless Calcite supports it, we'd probably just close it as Never.
          Hide
          julianhyde Julian Hyde added a comment -

          James Taylor, I think this should be a Phoenix issue. Do you agree?

          Show
          julianhyde Julian Hyde added a comment - James Taylor , I think this should be a Phoenix issue. Do you agree?

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              kliew Kevin Liew
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development