Yes, we are using the OR operation instead now. Anyway, thanks for logging
this, Julian.

Ken

On Mon, Sep 28, 2015 at 9:34 PM, Julian Hyde <[email protected]> wrote:

> Calcite doesn’t support IN in relational expressions, only in ASTs. You’ll
> have to manually rewrite to
>
> builder.filter(
>   builder.or(
>     builder.equals(builder.field(“id”), builder.literal(0)),
>     builder.equals(builder.field(“id”), builder.literal(2))))
>
> We should add RelBuilder.in(RexNode seek, RexNode terms…) as syntactic
> sugar. I have logged https://issues.apache.org/jira/browse/CALCITE-901 <
> https://issues.apache.org/jira/browse/CALCITE-901>.
>
> Julian
>
>
> > On Sep 28, 2015, at 4:28 AM, Ken <[email protected]> wrote:
> >
> > Hi,
> >
> > Can anyone tell me how to use the *IN* operator when building a Relation
> > Node?
> >
> > builder.filter(
> >                builder.call(SqlStdOperatorTable.IN, builder.field("id"),
> > builder.literal(0), builder.literal(2)));
> >
> > I try to execute this RelNode but always got error
> > message: java.lang.RuntimeException: cannot translate call IN($t0, $t6,
> $t8)
> >
> > There are no sample test code for the IN operator. Anyway knows?
> >
> > Thanks
> > Ken
>
>

Reply via email to