Re: Using Calcite in a multi-tenant application

2022-10-19 Thread JiaTao Tao
In fact, you can change calcite to use like HMS to manager schema Regards! Aron Tao Mike Albritton 于2022年10月20日周四 07:16写道: > Hi all, > > > I am considering using Calcite in a multi-tenant application that can run > queries from different customers in the same process and have a few >

Re: Does someone interested in integration calcite + PostgreSQL wire protocol ?

2022-10-06 Thread JiaTao Tao
+1 Regards! Aron Tao Julian Hyde 于2022年10月2日周日 05:06写道: > Thanks for trying, Dmitry. This happens a lot in commercial open source > (see Calcite’s Spark adapter, for instance) but once in a while you get > lucky, and that makes it worthwhile. > > Julian > > > > On Sep 28, 2022, at 3:18 AM,

Re: [DISCUSS] Trolls and community

2022-01-10 Thread JiaTao Tao
About maven, I still miss it. Arguing is pointless If all you have is a hammer, everything looks like a nail Regards! Aron Tao Vladimir Sitnikov 于2021年12月23日周四 07:10写道: > >[2] > http://ceki.blogspot.com/2010/05/forces-and-vulnerabilites-of-apache.html > > ^^ It is a must-read indeed. > I

Re: ProjectRemoveRule replaces project with its input ignoring alias

2021-11-25 Thread JiaTao Tao
In fact, calcite's rule doesn't care about alias, so it may lose alias when transforming. Regards! Aron Tao Yanjing Wang 于2021年11月24日周三 下午2:47写道: > Hi, team > I'm using ProjectRemoveRule to simplify my logical plan, But the plan > sometimes miss its project alias, I find the rule hasn't

Re: Extending Grammar Mapping

2021-11-09 Thread JiaTao Tao
It seems you needn't create a new "SqlCall" What's the problem you're having? Regards! Aron Tao Jeremy Dyer 于2021年11月4日周四 上午5:26写道: > Hello, > > I am working on a custom parser grammar that extends > "PostgresqlSqlDialect". I have a simple case where I want to allow my > grammar to accept

Re: How to get the real column name and data type from a SQL view ?

2021-11-09 Thread JiaTao Tao
May be you can try this: org.apache.calcite.rel.metadata.RelMetadataQuery#getColumnOrigins But i'm not tested yet. Pls give feedback whether it works or not. Regards! Aron Tao Armstrong 于2021年11月3日周三 下午10:09写道: > Hi guys, > Thanks for your time to read this help message. I'm new to

Re: Federated Query

2021-11-09 Thread JiaTao Tao
Yes, you can. I've done this, twice. Once you get the query plan, you can translate the calcite's plan to other engines. The main work is to define a SQL standard and align type system. Regards! Aron Tao Yogendra Sharma 于2021年11月2日周二 上午3:38写道: > Hi Team, > > I am exploring Apache Calcite to

Re: [ANNOUNCE] New committer: Xiong Duan

2021-10-28 Thread JiaTao Tao
Congratulations Regards! Aron Tao XING JIN 于2021年10月26日周二 下午1:17写道: > Congratulations ! > > Best, > Jin > > Chunwei Lei 于2021年10月25日周一 下午4:58写道: > > > Congratulations, Xiong! > > > > > > Best, > > Chunwei > > > > > > On Sun, Oct 24, 2021 at 6:34 AM Haisheng Yuan wrote: > > > > > Congrats,

Re: [DISCUSS] Draft board report for Oct 2021

2021-10-12 Thread JiaTao Tao
Thanks for your job, Haisheng. Looks like the format dose not meet your expectations if you were except markdown syntax. Regards! Aron Tao Haisheng Yuan 于2021年10月7日周四 下午1:29写道: > Thanks Stamatis and Francis for the addition, I will update the report > accordingly. > > Cheers, > Haisheng Yuan

Re: Disable the subquery

2021-10-12 Thread JiaTao Tao
Do you use the RelToSqlConverter to convert plan to sql? Regards! Aron Tao luoc 于2021年10月11日周一 下午4:30写道: > Hello Calcite team, > > > I am going to develop a new feature on my project with the Calcite. > But got the following issues : > > > Input SQL : > > > SELECT A.N_NAME, B.R_NAME FROM

Re: [ANNOUNCE] New committer: Zhaohui Xu

2021-10-12 Thread JiaTao Tao
Congratulations Regards! Aron Tao Alessandro Solimando 于2021年10月7日周四 下午3:44写道: > Congratulations Zhaohui, I have followed some of the contributions on the > view-based rewritings, thanks for all the improvements! > > Best regards, > Alessandro > > On Thu, 7 Oct 2021 at 07:27, Haisheng Yuan

Re: [ANNOUNCE] New committer: Vladimir Ozerov

2021-07-09 Thread JiaTao Tao
Congratulations Regards! Aron Tao Chunwei Lei 于2021年6月28日周一 下午2:56写道: > Congratulations, Vladimir! > > > Best, > Chunwei > > > On Sat, Jun 26, 2021 at 3:03 AM Vladimir Sitnikov < > sitnikov.vladi...@gmail.com> wrote: > > > Vladimir, welcome! > > > > >consistent signal from the "field" - lack

Re: Question: Hints & Rules

2021-05-30 Thread JiaTao Tao
ts already, one reason > for hints lost is that the projection are dropped for some reason( > maybe some optimization), and you should fix it if you wanna keep that. > > Best, > Danny Chan > > JiaTao Tao 于2021年5月27日周四 下午4:22写道: > > > Hi > > Indeed, there's some situa

Re: Question: Hints & Rules

2021-05-27 Thread JiaTao Tao
Hi Indeed, there's some situation will lose hints, like RelBuilder#project, we just construct a project without hints(ImmutableList.of()), so it will lose hints too. IMO, it's not ready for production, so finally, we give up this feature. Currently, hints occurs some times in the mail list, proves

Re: Issue with DDL Parsing - Postgres

2021-05-21 Thread JiaTao Tao
Hi maybe you can check this PostgresqlSqlDialect#PostgresqlSqlDialect Regards! Aron Tao Julian Hyde 于2021年5月20日周四 上午7:20写道: > The SQL string you posted does not contain the word “PRIMARY”, so the > error message is surprising. > > That said, Calcite’s dialect is different from PostgreSQL,

Re: AggregateUnionTransposeRule fails when some inputs have unique grouping key

2021-05-21 Thread JiaTao Tao
Sounds make sense Regards! Aron Tao Vladimir Ozerov 于2021年5月19日周三 下午8:57写道: > Hi, > > The AggregateUnionTransposeRule attempts to push the Aggregate below the > Union. > > Before: > Aggregate[group=$0, agg=SUM($1] > Union[all] > Input1 > Input2 > > After: > Aggregate[group=$0,

Re: Enumerable rules lost hint info

2021-05-20 Thread JiaTao Tao
ps://issues.apache.org/jira/browse/CALCITE-482 < https://issues.apache.org/jira/browse/CALCITE-482>. > > Julian > > > > On May 18, 2021, at 7:49 PM, JiaTao Tao wrote: > > > > Hi Julian > > > > When hints were introduced, was that part of the plan? &

Re: Tracking column's origin

2021-05-19 Thread JiaTao Tao
Hi org.apache.calcite.rel.metadata.RelMetadataQuery#getColumnOrigins may help Regards! Aron Tao James Daniel 于2021年5月19日周三 上午12:35写道: > Hi, all. > I am trying to rewrite the query plan by removing some nodes but faced with > issues related to manipulating column ref indexes. > > Let's

Re: Enumerable rules lost hint info

2021-05-18 Thread JiaTao Tao
return project_(nodes, fieldNames, ImmutableList.of(), force); } Regards! Aron Tao Julian Hyde 于2021年5月19日周三 上午12:30写道: > Do we really need hints in physical operators? When hints were introduced, > was that part of the plan? > > Julian > > > On May 17, 2021, at 11:50 PM,

Enumerable rules lost hint info

2021-05-18 Thread JiaTao Tao
Hi Recently, I'm integrating Calcite's hint into our system, and I've found the Enumerable rules just throw the hint info(ImmutableList.of()) away: public EnumerableProject( RelOptCluster cluster, RelTraitSet traitSet, RelNode input, List projects, RelDataType

Re: How to extend SQL type system?

2021-04-29 Thread JiaTao Tao
; > > On Apr 27, 2021, at 7:04 AM, JiaTao Tao wrote: > > > > I think the only way is to add your type to SqlTypeName and override > > RelDataTypeSystem/RelDataTypeFactory if needed > > > > Regards! > > > > Aron Tao > > > > > > Taras

Re: Do we have plans to do more work about CTE

2021-04-29 Thread JiaTao Tao
mization you had in > mind. > > > On Apr 27, 2021, at 6:51 AM, JiaTao Tao wrote: > > > > Seems we have very limited optimize about CTE current, do we have any > plan > > to improve this? > > > > > > Regards! > > > > Aron Tao > >

Re: How to extend SQL type system?

2021-04-27 Thread JiaTao Tao
I think the only way is to add your type to SqlTypeName and override RelDataTypeSystem/RelDataTypeFactory if needed Regards! Aron Tao Taras Ledkov 于2021年4月27日周二 下午5:42写道: > Hi all, > > I'm looking for the way to extend SQL types for my engine based on Calcite. > Now calcite doesn't support

Do we have plans to do more work about CTE

2021-04-27 Thread JiaTao Tao
Seems we have very limited optimize about CTE current, do we have any plan to improve this? Regards! Aron Tao

Re: PR for review

2021-04-25 Thread JiaTao Tao
I'll take a look Regards! Aron Tao 段雄 于2021年4月23日周五 下午2:54写道: > Hey guys, here is my PR needed one more review: > https://github.com/apache/calcite/pull/2402 I would appreciate if anyone > can review it. >

In piglet, allow creating a PigRelBuilder with custom "config.simplify()"(default is true)

2021-04-21 Thread JiaTao Tao
Hi fellows Recently, I've done CALCITE-4586, which removes Hook.REL_BUILDER_SIMPLIFY.addThread(Hook.propertyJ(false)); when creating the piglet#PigRelBuilder. So it may be perceived if you are using piglet#PigRelBuilder("config.simplify()"'s default value is true). It is expected that the change

Re: Reset/restart CI

2021-04-18 Thread JiaTao Tao
ron & Alessandro, > > Can you discuss & come to consensus in > https://issues.apache.org/jira/browse/CALCITE-4587 < > https://issues.apache.org/jira/browse/CALCITE-4587>, and create a PR. > > Julian > > > > > On Apr 17, 2021, at 10:12 PM, JiaTao Tao

Re: Reset/restart CI

2021-04-17 Thread JiaTao Tao
ather than statically setting a SparkConf option in the code as Aron is > suggesting. > > Best regards, > Alessandro > > On Fri, 16 Apr 2021 at 12:26, JiaTao Tao wrote: > > > Hi > > The problem may be the wrong hostname in "/etc/hosts", a way to s

Re: Reset/restart CI

2021-04-16 Thread JiaTao Tao
Hi The problem may be the wrong hostname in "/etc/hosts", a way to solve this problem is to set "spark.driver.bindAddress" explicitly, I've tested this and it works. I've created a JIRA(CALCITE-4587) and attached the PR( https://github.com/apache/calcite/pull/2404/files). Regards! Aron Tao

[jira] [Created] (CALCITE-4587) Set "spark.driver.bindAddress" explicitly to avoid java.net.BindException throw by Spark

2021-04-16 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4587: --- Summary: Set "spark.driver.bindAddress" explicitly to avoid java.net.BindException throw by Spark Key: CALCITE-4587 URL: https://issues.apache.org/jira/browse/CA

[jira] [Created] (CALCITE-4586) Make "RelBuilder.Config#simplify" configurable in "piglet.PigRelBuilder"

2021-04-15 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4586: --- Summary: Make "RelBuilder.Config#simplify" configurable in "piglet.PigRelBuilder" Key: CALCITE-4586 URL: https://issues.apache.org/jira/browse/CALCITE-4586

Re: "PigRelBuilder#create" maybe a wrong place to set Hook.REL_BUILDER_SIMPLIFY

2021-04-15 Thread JiaTao Tao
rmful (at worst, PigRelBuilder misses some > optimizations), but I suppose some users might like some more control. > Feel free to enhance it. > > On Thu, Apr 15, 2021 at 6:25 AM JiaTao Tao wrote: > > > > Hi, in PigRelBuilder#create, we set Hook.REL_BUILDER_SIMPLIFY

"PigRelBuilder#create" maybe a wrong place to set Hook.REL_BUILDER_SIMPLIFY

2021-04-15 Thread JiaTao Tao
Hi, in PigRelBuilder#create, we set Hook.REL_BUILDER_SIMPLIFY to false: public static PigRelBuilder create(FrameworkConfig config) { final RelBuilder relBuilder = RelBuilder.create(config); Hook.REL_BUILDER_SIMPLIFY.addThread(Hook.propertyJ(false)); return new PigRelBuilder(

[jira] [Created] (CALCITE-4583) Make simplification API more conservative in "RelBuilder#filter"

2021-04-15 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4583: --- Summary: Make simplification API more conservative in "RelBuilder#filter" Key: CALCITE-4583 URL: https://issues.apache.org/jira/browse/CALCITE-4583 Projec

[jira] [Created] (CALCITE-4578) skip SetOp#replaceInput when inputs are not changed

2021-04-11 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4578: --- Summary: skip SetOp#replaceInput when inputs are not changed Key: CALCITE-4578 URL: https://issues.apache.org/jira/browse/CALCITE-4578 Project: Calcite Issue

[jira] [Created] (CALCITE-4577) RelDigestWriter#done has performance when node's inputs is large

2021-04-11 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4577: --- Summary: RelDigestWriter#done has performance when node's inputs is large Key: CALCITE-4577 URL: https://issues.apache.org/jira/browse/CALCITE-4577 Project: Calcite

Re: Question about parallel query planning

2021-03-11 Thread JiaTao Tao
1, 2021 at 1:11 PM Julian Hyde > wrote: > > > > Are these, by any chance, pair-wise unions that can be flattened to > n-way unions? That kind of transformation is almost always beneficial. > > > > Julian > > > > > On Mar 11, 2021, at 12:34 AM, JiaTao T

Re: Question about parallel query planning

2021-03-11 Thread JiaTao Tao
Yes, it has the benefit. Regards! Aron Tao Julian Hyde 于2021年3月12日周五 上午5:11写道: > Are these, by any chance, pair-wise unions that can be flattened to n-way > unions? That kind of transformation is almost always beneficial. > > Julian > > > On Mar 11, 2021, at 12:34

Re: Question about parallel query planning

2021-03-11 Thread JiaTao Tao
Hi Jihoon Son I met the same problem(hundreds of union), and my advice is to move some rules to hep planner, like sub-query remove, union merge, etc. And this works for me. Regards! Aron Tao Julian Hyde 于2021年3月10日周三 上午2:59写道: > At a high level, the Volcano/Cascades planning algorithm is

Re: Nested loop joins

2021-03-01 Thread JiaTao Tao
In fact, it's a very common optimization that already implemented by other engines like Spark. Regards! Aron Tao JiaTao Tao 于2021年3月2日周二 上午11:39写道: > Hi > > I met the same problem and you can take a look at this JIRA. > I also pull a request, but it does not get merged: > htt

Re: Nested loop joins

2021-03-01 Thread JiaTao Tao
The JIRA is: https://issues.apache.org/jira/browse/CALCITE-4375 Regards! Aron Tao JiaTao Tao 于2021年3月2日周二 上午11:39写道: > Hi > > I met the same problem and you can take a look at this JIRA. > I also pull a request, but it does not get merged: > https://github.com/apache/ca

Re: Nested loop joins

2021-03-01 Thread JiaTao Tao
Hi I met the same problem and you can take a look at this JIRA. I also pull a request, but it does not get merged: https://github.com/apache/calcite/pull/2253 This optimization I think is very common and useful, I'll continue this work soon. cc Julian Regards! Aron Tao Priyendra Deshwal

Re: Performance degradation during query planning (vs Calcite 1.25)

2021-02-25 Thread JiaTao Tao
Well done, thanks Lgor. Regards! Aron Tao Chunwei Lei 于2021年2月22日周一 上午11:15写道: > Thank you for your work, Lgor. > > Would love to review the PR. > > > Best, > Chunwei > > > On Fri, Feb 12, 2021 at 1:49 AM Igor Lozynskyi > wrote: > > > Hi Calcite community! > > > > Before the upcoming 1.27

Re: [ANNOUNCE] New committer: Liya Fan

2021-02-22 Thread JiaTao Tao
Congratulations! Regards! Aron Tao xu 于2021年2月22日周一 下午1:27写道: > Congrats Liya! > > Forward Xu 于2021年2月22日周一 上午11:28写道: > > > Congratulations Liya! > > > > > > Best, > > > > Forward > > > > Chunwei Lei 于2021年2月22日周一 上午11:13写道: > > > > > Congratulations Liya! > > > > > > Best, > > > Chunwei

Re: calcite variable $cor0 is not found

2021-02-08 Thread JiaTao Tao
Hi You'd better do the subquery elimination. org.apache.calcite.tools.Programs#subQuery org.apache.calcite.tools.Programs.DecorrelateProgram Regards! Aron Tao you Zhuang 于2021年2月9日周二 上午8:31写道: > String sql = "select id, name, (select id from test.users where id = b.id) > as pid from

Re: [DISCUSS] Release Managers

2021-02-06 Thread JiaTao Tao
+1 with Danny Regards! Aron Tao Danny Chan 于2021年2月7日周日 上午10:31写道: > Just curious, when does Calcit plan to release 2.0, there are so many small > versions now ~ Do we really need to be 1.3x.0 or 1.4x.0 version ? > > Andrei Sereda 于2021年2月5日周五 上午2:34写道: > > > I'm happy to help with 1.30 > >

[jira] [Created] (CALCITE-4482) "ImmutableBeans.create" has performance issue

2021-01-31 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4482: --- Summary: "ImmutableBeans.create" has performance issue Key: CALCITE-4482 URL: https://issues.apache.org/jira/browse/CALCITE-4482 Project: Calcite

[jira] [Created] (CALCITE-4458) "rowTypeCoercion" for "SET" operations should be or relationship

2021-01-10 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4458: --- Summary: "rowTypeCoercion" for "SET" operations should be or relationship Key: CALCITE-4458 URL: https://issues.apache.org/jira/browse/CALCITE-4458

Re: How to rewrite a query using calcite. Any Example?

2021-01-06 Thread JiaTao Tao
here is an easier and out of the box way to do this? > > > Thanks. > > > On Tue, Jan 5, 2021 at 6:43 PM JiaTao Tao wrote: > > > Hi > > Try this: SqlParser.create(expr).parseExpression(); > > > > Regards! > > > > Aron Tao > > >

Re: How to rewrite a query using calcite. Any Example?

2021-01-05 Thread JiaTao Tao
Hi Try this: SqlParser.create(expr).parseExpression(); Regards! Aron Tao kant kodali 于2021年1月5日周二 上午9:34写道: > Hi All, > > is there a way to parse only the where clause using calcite (any sample > code)? meaning, for example, assume the input is something like > > view1.col1 = value1 or

Re: Proposal to extend Calcite into a incremental query optimizer

2020-12-23 Thread JiaTao Tao
Seems interesting, the pic can not be seen in the mail, may you open a JIRA for this, people who are interested in this can subscribe to the JIRA? Regards! Aron Tao Botong Huang 于2020年12月24日周四 上午3:18写道: > Hi all, > > This is a proposal to extend the Calcite optimizer into a general >

Re: [ANNOUNCE] New Calcite PMC chair: Haisheng Yuan

2020-12-17 Thread JiaTao Tao
Congratulations, Haisheng! Thank you for your service, Stamatis. Regards! Aron Tao Danny Chan 于2020年12月18日周五 上午10:05写道: > Congratulations, Haisheng! > > Thank you for your service, Stamatis. > > Julian Hyde 于2020年12月18日周五 上午9:58写道: > > > Congratulations, Haisheng! > > > > Thank you for your

Re: Using Calcite at LinkedIn

2020-12-13 Thread JiaTao Tao
/tree/master/coral-spark-plan > [2] > > https://github.com/linkedin/coral/blob/master/coral-spark-plan/src/test/java/com/linkedin/coral/sparkplan/SparkPlanToIRRelConverterTest.java > [3] > > https://jaceklaskowski.gitbooks.io/mastering-spark-sql/content/spark-sql-SparkStrategy-D

Re: Using Calcite at LinkedIn

2020-12-12 Thread JiaTao Tao
Hi Walaa Very happy to see this, our team basically do the same thing, a unified SQL layer: 1. Spark: RelNode -> Spark DataFrame plan 2. Presto: RelNode -> In string SQL 3. Clickhouse: RelNode -> Serialized RelNode 4. Flink -> TBD(with datastream API or table API) I do point 1 both in my

Why we repalce the literals in RexWindowBound with RexInputRef and put these literals to Window#constants

2020-12-10 Thread JiaTao Tao
Hi Current we got like this in Window#Group if we wrote SQL like `rows between 0 preceding and 2 following` $3 PRECEDING $4 FOLLOWING $3 and $4 is input ref, and we had to find $3 and $4 in Window#constant, and all digest about Window#Group doesn't replace the ref back to literal, so it lost the

Re: grouping() function occurs value large than 1

2020-12-09 Thread JiaTao Tao
; Of course you can use whichever you like in your queries. > > Julian > > > On Dec 8, 2020, at 19:00, JiaTao Tao wrote: > > > > Hi Julian > > I see, thanks, maybe use grouping id is better? Cuz seems not every > engine > > has this grouping behavior, in

Re: grouping() function occurs value large than 1

2020-12-08 Thread JiaTao Tao
nts, it > returns an integer bitmask with N bits. > > PostgreSQL has the same behavior: see example in > https://www.postgresql.org/docs/9.5/functions-aggregate.html. > > Julian > > On Tue, Dec 8, 2020 at 12:30 AM JiaTao Tao wrote: > > > > Hi > > After AggregateEx

grouping() function occurs value large than 1

2020-12-08 Thread JiaTao Tao
Hi After AggregateExpandDistinctAggregatesRule, I got a plan like this: The $10 in the project node is $g=[GROUPING($0, $1, $2, $3, $4, $5, $6, $7, $8)]) and we can see it is compared with value 1/2/3, but I check the def of grouping(), both pg and oracle, the value of grouping is 0 or 1.

Re: [HELP] Local build fails

2020-12-04 Thread JiaTao Tao
Currently, I've not encountered such a situation, my java version is 212. But I'm always encountered with geode: timeout, wonder anybody has met this problem. Regards! Aron Tao Chunwei Lei 于2020年12月4日周五 下午6:15写道: > My Java version is: > > java version "1.8.0_151" > Java(TM) SE Runtime

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-04 Thread JiaTao Tao
al > problem. So, I will not merge a fix for getRelList performance until > after the algorithmic problem has been resolved. > > On Thu, Dec 3, 2020 at 6:54 PM JiaTao Tao wrote: > > > > Hi Julian > > > > Thanks, Julian, your advice is really helpful! Do you mind I pull a

[jira] [Created] (CALCITE-4428) Remove equiv rel from mapRel2Subset when merging set

2020-12-03 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4428: --- Summary: Remove equiv rel from mapRel2Subset when merging set Key: CALCITE-4428 URL: https://issues.apache.org/jira/browse/CALCITE-4428 Project: Calcite Issue

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-03 Thread JiaTao Tao
, I will not merge a fix for getRelList performance until after the algorithmic problem has been resolved. On Thu, Dec 3, 2020 at 6:54 PM JiaTao Tao wrote: > > Hi Julian > > Thanks, Julian, your advice is really helpful! Do you mind I pull a request > to merge your code so that we

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-03 Thread JiaTao Tao
Hi Vladimir I got your opinion, may we do a quick fix about the performance, then I'll take a look again about this. Regards! Aron Tao Vladimir Sitnikov 于2020年12月4日周五 上午5:13写道: The improvement to RelTraitSet.satisfies would be nice, however, I still believe getRelList must not be used in

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-03 Thread JiaTao Tao
Hi Julian Thanks, Julian, your advice is really helpful! Do you mind I pull a request to merge your code so that we can improve the performance very quickly? About " stored the list of RelNodes ", do you concern about the duplicate "relnode" store in "relsubset"? IMO, what we store is a

[jira] [Created] (CALCITE-4426) Improve the performance of RelSubset#getRelList

2020-12-03 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4426: --- Summary: Improve the performance of RelSubset#getRelList Key: CALCITE-4426 URL: https://issues.apache.org/jira/browse/CALCITE-4426 Project: Calcite Issue Type

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-03 Thread JiaTao Tao
aste your findings. > I would like to look into it if I find some time. > > Best, > Chunwei > > > On Thu, Dec 3, 2020 at 1:15 PM JiaTao Tao wrote: > > > Hi Vladimir > > Thanks for your reply: > > 1. I run TpchTest#testQuery07 in my MPB, the avg time is 43

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-03 Thread JiaTao Tao
Hi the flame graph is IDEA's feature, you can directly run with the flame graph. As I said does increase the time, but the time is almost from getRelList, so if we can opt getRelList, the overhead is gone. Regards! Aron Tao Vladimir Sitnikov 于2020年12月3日周四 下午9:02写道: > >From the flame

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-03 Thread JiaTao Tao
l those cases. Regards! Aron Tao Vladimir Sitnikov 于2020年12月3日周四 下午5:48写道: JiaTao Tao, thanks for the details! JiaTao Tao> found. Without pull/, some cases will fail due to "There are not enough JiaTao Tao> rules to produce a node with desired properties: There is 1 empty subset

Re: TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-02 Thread JiaTao Tao
Hi Vladimir Thanks for your reply: 1. I run TpchTest#testQuery07 in my MPB, the avg time is 43s, and after re-run the PR ut, the ut is passed, so this ut timeout may be an occasional situation. 2. For the pull/, it due increase the time of TpchTest#testQuery07, about 23%, sorry for that, we

TpchTest#testQuery07 timeout when running continuous-integration/appveyor/pr

2020-12-02 Thread JiaTao Tao
Hi fellows My PR failed due to, seems an unstable ut, have anyone met this? FAILURE 300.8sec, org.apache.calcite.adapter.tpch.TpchTest > testQuery07() java.util.concurrent.TimeoutException: testQuery07() timed out after 5 minutes https://github.com/apache/calcite/pull/2284

[jira] [Created] (CALCITE-4424) RexUtil#isDeterministic should consider SqlOperator#isDynamicFunction

2020-12-01 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4424: --- Summary: RexUtil#isDeterministic should consider SqlOperator#isDynamicFunction Key: CALCITE-4424 URL: https://issues.apache.org/jira/browse/CALCITE-4424 Project

Re: [DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-25 Thread JiaTao Tao
her codes that are not debug-friendly and we can not > change them all. > > > Best, > Chunwei > > > On Tue, Nov 24, 2020 at 10:59 AM JiaTao Tao wrote: > > > Hi James > > My point is not all intermediate variables, please don't expand the > scope, > > you

Re: [DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-25 Thread JiaTao Tao
e. > 2) there might be other codes that are not debug-friendly and we can not > change them all. > > > Best, > Chunwei > > > On Tue, Nov 24, 2020 at 10:59 AM JiaTao Tao wrote: > > > Hi James > > My point is not all intermediate variables, please

Re: Decouple core from linq4j and Avatica

2020-11-24 Thread JiaTao Tao
+1 for this idea, I have been developing Calcite for a long time(counting during project Kylin), we all treat calcite as an optimizer, but we need to consider overhead. I aggre with Stamatis: "since those dependencies were not causing any real trouble." What really troubling me is that when we

Re: [DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-23 Thread JiaTao Tao
return them, e.g. > > > > final RelNode r = relBuilder.build(); > > return r; > > > > I am not fond of that pattern either. > > > > Julian > > > > > > > > > On Nov 23, 2020, at 6:32 AM, Albert wrote: > >

Re: [Question] How to leverage Calcite adaptor for federated SQL query without using Calcite parser

2020-11-23 Thread JiaTao Tao
nn)`, which > will bring Calcite parser to parser SQL instead of my own. : ( > Is there any approach to make Calcite call the custom adapter and > third-party parser? > > > Best wishes, > Trista > > > > > Juan Pan (Trista) > > Senior DBA & PMC of Apache

Re: [DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-23 Thread JiaTao Tao
42:21, Danny Chan wrote: > > I kind of agree, but it's more like a programming specification, we can > > tell people how to write codes but they may not follow those rules. > > > > JiaTao Tao 于2020年11月22日周日 下午5:27写道: > > > > > Why I don't want to debug into

Re: [Question] How to leverage Calcite adaptor for federated SQL query without using Calcite parser

2020-11-22 Thread JiaTao Tao
he.org/document/current/en/features/sharding/principle/parse > > > Juan Pan (Trista) > > Senior DBA & PMC of Apache ShardingSphere > E-mail: panj...@apache.org > > > > > On 11/22/2020 16:17,JiaTao Tao wrote: > In fact, parse twice's impact is little, in Apache Ky

Re: A question regarding querying Google Cloud BigTable or Spanner through Apache Calcite

2020-11-22 Thread JiaTao Tao
; Juan Pan (Trista) > > Senior DBA & PMC of Apache ShardingSphere > E-mail: panj...@apache.org > > > > > On 11/22/2020 16:39,JiaTao Tao wrote: > I think you are talking about query federation, yes, it's a good case for > Caclite. > > > Regards! > &g

Re: [DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-22 Thread JiaTao Tao
uot;, you have to go back to see these. Regards! Aron Tao JiaTao Tao 于2020年11月22日周日 下午5:23写道: > Hi > I've been developed Calcite full time for a quite long time, and I ofter > debug in the rule to see the transformations, but code like this is not > debuging friendly i

[DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-22 Thread JiaTao Tao
Hi I've been developed Calcite full time for a quite long time, and I ofter debug in the rule to see the transformations, but code like this is not debuging friendly in my opinion: "call.transformTo(relBuilder.build())" I want to see the relBuilder.build()'s result, I have to debug into the

Re: A question regarding querying Google Cloud BigTable or Spanner through Apache Calcite

2020-11-22 Thread JiaTao Tao
I think you are talking about query federation, yes, it's a good case for Caclite. Regards! Aron Tao Jason Chen 于2020年11月4日周三 上午8:06写道: > Hey, > > I am Jason Chen from Shopify Data Science and Engineering team. I have a > few questions regarding the Apache Calcite, and I am not sure if the

Re: [Question] How to leverage Calcite adaptor for federated SQL query without using Calcite parser

2020-11-22 Thread JiaTao Tao
In fact, parse twice's impact is little, in Apache Kylin, every time we do the transformation to SQL, we re-parse it. What really takes time is validation (use metadata like getting it from HMS) and optimization. Regards! Aron Tao Juan Pan 于2020年11月22日周日 下午2:32写道: > Hi community, > > > > >

Re: [Question] How to leverage Calcite adaptor for federated SQL query without using Calcite parser

2020-11-22 Thread JiaTao Tao
There seems to be no easy way to do this, you can take look at Hive, it uses its own parser to parse SQL and use Caclite to do the optimization. By the way, Calcite's parser is quite OK both in compatibility and performance(javacc is faster than Antlr), in Bytedance, we use Calcite to do the

[jira] [Created] (CALCITE-4413) Duplicate RAND() after optimizer

2020-11-19 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4413: --- Summary: Duplicate RAND() after optimizer Key: CALCITE-4413 URL: https://issues.apache.org/jira/browse/CALCITE-4413 Project: Calcite Issue Type: Bug

[jira] [Created] (CALCITE-4411) Rel to SQL lost distinct when doing window

2020-11-19 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4411: --- Summary: Rel to SQL lost distinct when doing window Key: CALCITE-4411 URL: https://issues.apache.org/jira/browse/CALCITE-4411 Project: Calcite Issue Type: Bug

Re: [DISCUSS] State of the project 2020

2020-11-08 Thread JiaTao Tao
Hi Stamatis, Thanks for your great work. 2) What areas do we need to do better? 1. Lattice/Materialized view 2. Streaming(we can more contact with Flink project) 3) Which other candidates should we consider for PMC chair? I think Haisheng and Danny are all excellent choices. Regards! Aron Tao

[jira] [Created] (CALCITE-4385) Adding optimization to simplify the And/Or condition

2020-11-08 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4385: --- Summary: Adding optimization to simplify the And/Or condition Key: CALCITE-4385 URL: https://issues.apache.org/jira/browse/CALCITE-4385 Project: Calcite

[jira] [Created] (CALCITE-4381) CoreQuidemTest#8 throws ArrayIndexOutOfBoundsException when enable ProjectJoinTransposeRule

2020-11-05 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4381: --- Summary: CoreQuidemTest#8 throws ArrayIndexOutOfBoundsException when enable ProjectJoinTransposeRule Key: CALCITE-4381 URL: https://issues.apache.org/jira/browse/CALCITE-4381

[jira] [Created] (CALCITE-4378) Included ProjectJoinTransposeRule in the main optimizer process

2020-11-05 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4378: --- Summary: Included ProjectJoinTransposeRule in the main optimizer process Key: CALCITE-4378 URL: https://issues.apache.org/jira/browse/CALCITE-4378 Project: Calcite

[jira] [Created] (CALCITE-4375) merge join condition that has "OR" as much as possible

2020-11-03 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4375: --- Summary: merge join condition that has "OR" as much as possible Key: CALCITE-4375 URL: https://issues.apache.org/jira/browse/CALCITE-4375 Projec

[jira] [Created] (CALCITE-4359) EnumerableProject.create didn't consider input's traitSet

2020-10-27 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4359: --- Summary: EnumerableProject.create didn't consider input's traitSet Key: CALCITE-4359 URL: https://issues.apache.org/jira/browse/CALCITE-4359 Project: Calcite

[jira] [Created] (CALCITE-4358) Potential memory leak in VolcanoPlanner#materializations due to circular reference

2020-10-27 Thread Jiatao Tao (Jira)
Jiatao Tao created CALCITE-4358: --- Summary: Potential memory leak in VolcanoPlanner#materializations due to circular reference Key: CALCITE-4358 URL: https://issues.apache.org/jira/browse/CALCITE-4358

Re: Why ProjectJoinTransposeRule not in Calcite default rule set.

2020-10-27 Thread JiaTao Tao
sts need to be updated? > > > > > > -Rui > > > > On Mon, Oct 26, 2020 at 2:14 AM Fan Liya wrote: > > > > > I also think the ProjectJoinTransposeRule should be included in the > main > > > optimizer process. > > > > >

Potential memory leak in VolcanoPlanner#materializations due to circular reference

2020-10-27 Thread JiaTao Tao
Hi fellows We use Calcite's materialization view in our product env, and it OOM times, I dig the memory dump and found there all of RelOptMaterialization instance. We will call Planner#clear before every query, and inside the dump, there are lots of planner instance, soI suspect it is a circular

Why ProjectJoinTransposeRule not in Calcite default rule set.

2020-10-22 Thread JiaTao Tao
This rule is only used in RelOptMaterializations#substitute, is not in Calcite's main optimizer process(RelOptUtil#registerDefaultRules), wonder why, seems a common rule. Regards! Aron Tao

Re: RelBuilder#project should try keep alias in optimizer

2020-10-22 Thread JiaTao Tao
道: > Did you read the javadoc for the two ‘project’ methods? > > Julian > > > > On Oct 22, 2020, at 1:15 AM, JiaTao Tao wrote: > > > > Some rules we use `RelBuilder project(Iterable nodes) > `, > > sometimes use `RelBuilder project(Iterable nodes, &g

Re: RelBuilder#project should try keep alias in optimizer

2020-10-22 Thread JiaTao Tao
Some rules we use `RelBuilder project(Iterable nodes) `, sometimes use `RelBuilder project(Iterable nodes, Iterable fieldNames)`, and this really makes me confused. Regards! Aron Tao JiaTao Tao 于2020年10月22日周四 下午4:13写道: > Thanks, Julian > One more question is that I can se

Re: RelBuilder#project should try keep alias in optimizer

2020-10-22 Thread JiaTao Tao
584. I think that answers your question. > > Julian > > > On Oct 21, 2020, at 23:35, JiaTao Tao wrote: > > > > Hi Danny > > Thanks for your reply, can you explain "Calcite only optimize based on > the > > field input refs, if we always keep the alias,

Re: RelBuilder#project should try keep alias in optimizer

2020-10-22 Thread JiaTao Tao
/CALCITE-4037 > [2] https://issues.apache.org/jira/browse/CALCITE-3662 > [3] https://issues.apache.org/jira/browse/CALCITE-1584 > > Best, > Danny Chan > 在 2020年10月21日 +0800 PM2:49,JiaTao Tao ,写道: > > Hi fellows > > I found in some place, we just call `project(Iterable &

  1   2   >