Re: [DISCUSS] New RexNode: RexListCmp

2020-07-21 Thread Scott Reynolds
I wanted to reply and share our recent requirement for handling SQL like the following `error_code IN (3002, 3030)' and the challenges we faced. For our implementation on top of Apache Kudu, each disjunction creates a `Scanner' – a resource we need to limit as it represents a denial of service

Re: [DISCUSS] New RexNode: RexListCmp

2020-07-20 Thread Stamatis Zampetakis
Another quick thought as far as it concerns the IN operator would be to use RexCall as it is right now where the first operand in the list is a RexInputRef for instance and the rest are the literals. I assume that taking this direction would need to change a bit the respective SqlOperator. I

Re: [DISCUSS] New RexNode: RexListCmp

2020-07-20 Thread Julian Hyde
The name isn't very intuitive. The concept of a list and a comparison operator seems OK. As Vladimir points out, it is somewhat similar to RexSubQuery, so maybe this could be a sub-class (but organizing the data a bit more efficiently). I would be very wary of null semantics. RexNode scalar

Re: [DISCUSS] New RexNode: RexListCmp

2020-07-20 Thread Vladimir Sitnikov
>Do you know what is the impact on Enumerable implementation? I guess there are plenty of options there. The key question regarding RexListCmp is as we introduce a new Rex node, all the planning rules and all engines must support it somehow. Technically speaking, we have RexSubQuery. Haisheng,

Re: [DISCUSS] New RexNode: RexListCmp

2020-07-20 Thread Rui Wang
Hi Haisheng, Do you know what is the impact on Enumerable implementation? Will RexListCmp still be converted AND/OR something else in that layer or there will be new logic introduced to generate code for RexListCmp? -Rui On Sun, Jul 19, 2020 at 10:13 PM Enrico Olivelli wrote: > Il Lun 20 Lug

Re: [DISCUSS] New RexNode: RexListCmp

2020-07-19 Thread Enrico Olivelli
Il Lun 20 Lug 2020, 03:00 Haisheng Yuan ha scritto: > Hi all, > > This is a rough idea, I'd like to see how the community think about it. > > RexListCmp extends RexNode / RexCall { > public final SqlOperator op; > public final RexNode left; > public final ImmutableList list; > public

[DISCUSS] New RexNode: RexListCmp

2020-07-19 Thread Haisheng Yuan
Hi all, This is a rough idea, I'd like to see how the community think about it. RexListCmp extends RexNode / RexCall { public final SqlOperator op; public final RexNode left; public final ImmutableList list; public final RexQuantifier quantifier; public final RelDataType type; } Enum