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

Amir Gajst commented on CALCITE-3524:
-------------------------------------

Here is an example of calling RexSubQuery.in() through the RelBuilder.
 The method's signature is exactly the same as RexSubQuery.in() but by adding 
it to RelBuilder we make it more accessible.
{code:java}
RelNode root = builder.scan("EMP")
  .filter(
    builder.in(
      builder.scan("DEPT")
      .filter(
        builder.call(SqlStdOperatorTable.EQUALS,
          builder.field("DNAME"),
          builder.literal("AAA")))
      .project(builder.field("DEPTNO"))
      .build(),
      ImmutableList.of(builder.field("DEPTNO"))))
  .build();
 {code}

> Add methods to RelBuilder to create RexSubQuery
> -----------------------------------------------
>
>                 Key: CALCITE-3524
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3524
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Amir Gajst
>            Assignee: Amir Gajst
>            Priority: Minor
>
> When building relational expressions, the simplest way is by using the 
> RelBuilder which does not currently support creation of a RexSubQuery.
> We can add RexSubQuery creation functions to the RelBuilder to make it more 
> "visible" and convenient to use. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to