Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread Jinpeng Wu
Hi, Xiening. Regarding calculating the logical cost, here are some ways I though: 1. Logical rel may implement their own computeSelfCost method. Some rels can provide such information, for example the LogicalProject/LogicalFilter contains nearly the same information as their physical

Re: RelMetadataQuery.getRowCount stackoverflow

2020-04-20 Thread Haisheng Yuan
Can you add a reproducible test case and log a JIRA? It may be different with CALCITE-2057. People who is interested will investigate the issue. On 2020/04/21 04:24:31, JiaTao Tao wrote: > Thanks > I didn't add any new rule, just these: > > CONSTANT_REDUCTION_RULES > ABSTRACT_RELATIONAL_RULES

Re: RelMetadataQuery.getRowCount stackoverflow

2020-04-20 Thread JiaTao Tao
Thanks I didn't add any new rule, just these: CONSTANT_REDUCTION_RULES ABSTRACT_RELATIONAL_RULES BASE_RULES ABSTRACT_RULES ENUMERABLE_RULES So this is a bug, or it just because of the call stack is too deep(if this, I can adjust JVM parameter). Regards! Aron Tao Scott Reynolds 于2020年4月21日周二

Calcite-Master - Build # 1708 - Still Failing

2020-04-20 Thread Apache Jenkins Server
The Apache Jenkins build system has built Calcite-Master (build #1708) Status: Still Failing Check console output at https://builds.apache.org/job/Calcite-Master/1708/ to view the results.

Understanding annotations of SqlGroupingFunction

2020-04-20 Thread ZZY
Hi, Hyde: It's confused me that some annotations in Calcite(org.apache.calcite.sql.fun.SqlGroupingFunction.java) : /** * The {@code GROUPING} function. * * Accepts 1 or more arguments. * Example: {@code GROUPING(deptno, gender)} returns * 3 if both deptno and gender are being grouped, * 2 if

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread Haisheng Yuan
Hi Hanumath, The trait in the example is for distribution only for brevity, not including collation. No matter it is hash join or merge join or nestedloop join, the same distribution applied. > Are you planning to use the same interface as that of VolcanoPlanner? Yes, not only for

[jira] [Created] (CALCITE-3941) Add the default mode to the path in the Json functions.

2020-04-20 Thread Forward Xu (Jira)
Forward Xu created CALCITE-3941: --- Summary: Add the default mode to the path in the Json functions. Key: CALCITE-3941 URL: https://issues.apache.org/jira/browse/CALCITE-3941 Project: Calcite

Re: [discuss] Add the default mode to the path in the Json functions.

2020-04-20 Thread Forward Xu
Hi Julian, Thank you for bringing such a good shared link, there are some areas in the JSON function that need to be improved and implemented. I will continue to improve it. Forward Julian Hyde 于2020年4月21日周二 上午1:28写道: > Speaking of JSON functions, JOOQ creator Lukas Eder has been giving JSON >

Re: Stored Proc to Relational Expression

2020-04-20 Thread Julian Hyde
Calcite relational expressions can represent SELECT, INSERT etc. but not procedural code. It’s a direction we could consider going. RexProgram is the closest thing we currently have to procedural code in the algebra - single assignment of variables, use of variables in expressions assigning to

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread hanu mapr
Hello Haisheng, Thanks for the detailed analysis on the support for cascades framework. I am quite interested to be part of the new optimization framework. I believe this a very important infrastructural work to make calcite a robust query optimizer. I like your approach on the trait

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread Xiening Dai
Hi Jinpeng, Regarding this comment - I believe there are ways to calculate the logical cost, but I think it’s not that simple as "cardinality * unit_copy_cost.”, would you provide more details of other different ways? Just the algorithm description or pseudo code would help us understand.

Re: [discuss] Add the default mode to the path in the Json functions.

2020-04-20 Thread Julian Hyde
Speaking of JSON functions, JOOQ creator Lukas Eder has been giving JSON functions in MySQL/MariaDB a good workout over the last few days. It’s amusing to read what he has discovered: https://twitter.com/lukaseder Julian > On Apr 20, 2020, at 8:27 AM,

Re: RelMetadataQuery.getRowCount stackoverflow

2020-04-20 Thread Scott Reynolds
I have had this happen numerous times when writing new planner rules. Most of the time my rule is missing some boolean logic to prevent itself from transforming the call. This results in the rule continuously transforming it's previous transformations. I can usually see this happening when I add

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread Haisheng Yuan
Igor, That's great. On 2020/04/20 11:17:49, Seliverstov Igor wrote: > Haisheng, Xiening, > > Ok, Now I see how it should work. > > Thanks for your replies. > > Regards, > Igor > > > 20 апр. 2020 г., в 09:56, Seliverstov Igor > > написал(а): > > > > Haisheng, Xiening, > > > > Thanks for

Re: [discuss] Add the default mode to the path in the Json functions.

2020-04-20 Thread Stamatis Zampetakis
Hi, I know that Oracle uses lax by default [1] but I don't remember what other DBMS do. In any case adopting a default mode sounds like a reasonable thing to do. Best, Stamatis [1] https://docs.oracle.com/database/121/ADXDB/json.htm#ADXDB6259 On Mon, Apr 20, 2020, 7:28 AM Chunwei Lei wrote:

Calcite-Master - Build # 1707 - Failure

2020-04-20 Thread Apache Jenkins Server
The Apache Jenkins build system has built Calcite-Master (build #1707) Status: Failure Check console output at https://builds.apache.org/job/Calcite-Master/1707/ to view the results.

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread Seliverstov Igor
Haisheng, Xiening, Ok, Now I see how it should work. Thanks for your replies. Regards, Igor > 20 апр. 2020 г., в 09:56, Seliverstov Igor написал(а): > > Haisheng, Xiening, > > Thanks for clarifying. > > In this proposal, we are not trying to split logical and physical planning >

RelMetadataQuery.getRowCount stackoverflow

2020-04-20 Thread JiaTao Tao
Hi Has anyone encountered this problem before? Just a simple query(no more than 20 lines, two joins, no union). And I see this ticket: https://issues.apache.org/jira/browse/CALCITE-2057, but there's no follow up, also I see flink may occur this problem( https://developer.aliyun.com/ask/129548)

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread Seliverstov Igor
Haisheng, Xiening, Thanks for clarifying. *In this proposal, we are not trying to split logical and physical planning entirely. *- actually I was in doubt about an idea of entire splitting logical and physical phases, if you aren't going to, I have no objections. But it returns me to my first

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-20 Thread 吴金朋
Hi, Haisheng and Igor. I think we do need the ability for logical space pruning. But we can achieve it step by step. In the first trial, we implement and optimize a rel only after it is fully explored. And then, after solving problems like group sharing stats and logical cost accuracy, we move it