Re: [DISCUSSION] Extension of Metadata Query

2019-06-11 Thread Yuzhao Chen
We have an interface to fetch the RelMetadataQuery in RelOptRuleCall [1], which I believe is the most common routine to query metadata during planning, I’m a little confused for your saying >The methods in RelMetadataQuery are for convenience only. If these methods in RelMetadataQuery are only

[jira] [Created] (CALCITE-3124) Infinite rule matching when AggregateRemoveRule is enabled for SUM0

2019-06-11 Thread Haisheng Yuan (JIRA)
Haisheng Yuan created CALCITE-3124: -- Summary: Infinite rule matching when AggregateRemoveRule is enabled for SUM0 Key: CALCITE-3124 URL: https://issues.apache.org/jira/browse/CALCITE-3124 Project:

Re: Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Muhammad Gelbana
Sorry folks. False alarm. The aggregator works fine, but my table scan was faulty. Thanks, Gelbana On Tue, Jun 11, 2019 at 9:24 PM Muhammad Gelbana wrote: > With pleaseure. I'll try to fix it first to confirm that my assumption is > correct. > > Thanks, > Gelbana > > > On Tue, Jun 11, 2019 at

Re: [DISCUSSION] Extension of Metadata Query

2019-06-11 Thread Julian Hyde
The goal is that it should be possible to add a new kind of metadata. The methods in RelMetadataQuery are for convenience only. So you should be able to use your new kind of metadata, and existing ones, without modifying RelMetadataQuery. If that is not possible, it’s a bug, and you should log

Re: Re: Select into Temporary Table

2019-06-11 Thread Haisheng Yuan
For historical reasons, perhaps. We need to parse and translate into CREATE TABLE AS SELECT... if we are going to support this syntax for Postgres and SQL Server. - Haisheng -- 发件人:Julian Hyde 日 期:2019年06月12日 05:41:38 收件人: 主 题:Re:

Re: Select into Temporary Table

2019-06-11 Thread Julian Hyde
In answer to your question, no I don't think Calcite should support SELECT INTO. On Tue, Jun 11, 2019 at 2:53 PM Andrew O wrote: > > Indeed, unfortunately in this case it's pre-generated SQL so unfortunately > is a fixed input style. > > On Tue, 11 Jun 2019, 22:41 Julian Hyde, wrote: > > >

Re: Select into Temporary Table

2019-06-11 Thread Andrew O
Indeed, unfortunately in this case it's pre-generated SQL so unfortunately is a fixed input style. On Tue, 11 Jun 2019, 22:41 Julian Hyde, wrote: > I’ve never understood why some SQL dialects have “SELECT ... INTO table”. > What’s wrong with “INSERT INTO table SELECT ...”? > > Julian > > > On

Re: Select into Temporary Table

2019-06-11 Thread Julian Hyde
I’ve never understood why some SQL dialects have “SELECT ... INTO table”. What’s wrong with “INSERT INTO table SELECT ...”? Julian > On Jun 11, 2019, at 1:27 PM, Andrew O wrote: > > Does / should Calcite support select into expressions? E.g. I'm using v1.19 > with queries of the style: > >

Re: Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Muhammad Gelbana
With pleaseure. I'll try to fix it first to confirm that my assumption is correct. Thanks, Gelbana On Tue, Jun 11, 2019 at 8:44 PM Haisheng Yuan wrote: > Cool, can you create an issue for this bug? > > - Haisheng > > -- >

Re: Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Haisheng Yuan
Cool, can you create an issue for this bug? - Haisheng -- 发件人:Muhammad Gelbana 日 期:2019年06月12日 02:39:20 收件人:dev@calcite.apache.org (dev@calcite.apache.org) 抄 送:Haisheng Yuan 主 题:Re: How to avoid SUM0 or disable a rule ? I believe

Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Vamshi Krishna
It's done in the SqlToRelConverter.java:5427. I don't think there is a way currently to disable it (i may be wrong). There should be a configurable option to disable this. -Vamshi On Tue, Jun 11, 2019 at 2:31 PM Muhammad Gelbana wrote: > > I just cleared the reducible aggregate calls

Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Muhammad Gelbana
I believe it's a bug because DoubleSum (Also LongSum and IntSum) are initialized with a value of 0 [1] [1] https://github.com/apache/calcite/blob/a3c56be7bccc58859524ba39e5b30b7078f97d00/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java#L459 Thanks, Gelbana On Tue, Jun 11,

Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Muhammad Gelbana
I just cleared the reducible aggregate calls collection at runtime (to void the rule) and I'm still facing the same problem. This onviously has nothing to do with the rule. I'll investigate further. Thanks for your help. Thanks, Gelbana On Tue, Jun 11, 2019 at 8:16 PM Haisheng Yuan wrote: >

Re: How to avoid SUM0 or disable a rule ?

2019-06-11 Thread Haisheng Yuan
Hi Gelbana, You can construct your own AggregateReduceFunctionsRule instance by specifying the functions you want to reduce: public AggregateReduceFunctionsRule(Class aggregateClass, RelBuilderFactory relBuilderFactory, EnumSet functionsToReduce) { But I think the issue you described might