Re: Translation of SQL EXISTS

2020-02-20 Thread Christian Beikov
Calcite is counter intuitive. It should be in reverse order, first generate a semi or anti-semi join, then generate an inner/outer join. - Haisheng -- 发件人:Christian Beikov 日 期:2020年02月19日 21:12:13 收件人: 主 题:Translation of SQL EXISTS

Re: Translation of SQL EXISTS

2020-02-20 Thread Julian Hyde
semi join, then generate an >>> inner/outer join. >>> >>> - Haisheng >>> >>> -- >>> 发件人:Christian Beikov >>> 日 期:2020年02月19日 21:12:13 >>> 收件人: >>>

Re: Translation of SQL EXISTS

2020-02-20 Thread Christian Beikov
this process in Calcite is counter intuitive. It should be in reverse order, first generate a semi or anti-semi join, then generate an inner/outer join. - Haisheng -- 发件人:Christian Beikov 日 期:2020年02月19日 21:12:13 收件人: 主 题:Translation

Re: Translation of SQL EXISTS

2020-02-19 Thread Julian Hyde
--- > 发件人:Christian Beikov > 日 期:2020年02月19日 21:12:13 > 收件人: > 主 题:Translation of SQL EXISTS > > Hello, > > I'm a bit confused about how the SQL EXISTS predicate is translated. I'd > assume that an EXISTS is translated in relational algebra to a S

Re: Re: Translation of SQL EXISTS

2020-02-19 Thread Haisheng Yuan
-- 发件人:Christian Beikov 日 期:2020年02月20日 03:11:02 收件人:Haisheng Yuan; Apache Calcite dev list 主 题:Re: Translation of SQL EXISTS Hey Haisheng, it is nice to have a rule that detects such patterns but do you agree that it would be better to generate

Re: Translation of SQL EXISTS

2020-02-19 Thread Christian Beikov
:Translation of SQL EXISTS Hello, I'm a bit confused about how the SQL EXISTS predicate is translated. I'd assume that an EXISTS is translated in relational algebra to a SEMI- and NOT EXISTS to an ANTI-join, but it's not. PlannerImpl p = new PlannerImpl(config); SqlNode

Re: Translation of SQL EXISTS

2020-02-19 Thread Haisheng Yuan
:Christian Beikov 日 期:2020年02月19日 21:12:13 收件人: 主 题:Translation of SQL EXISTS Hello, I'm a bit confused about how the SQL EXISTS predicate is translated. I'd assume that an EXISTS is translated in relational algebra to a SEMI- and NOT EXISTS to an ANTI-join, but it's not. PlannerImpl p = new

Translation of SQL EXISTS

2020-02-19 Thread Christian Beikov
Hello, I'm a bit confused about how the SQL EXISTS predicate is translated. I'd assume that an EXISTS is translated in relational algebra to a SEMI- and NOT EXISTS to an ANTI-join, but it's not. PlannerImpl p = new PlannerImpl(config); SqlNode sqlNode = p.parse("delete from _order o where