[VOTE] Release Apache Calcite 1.31.0 (release candidate 0)

2022-07-22 Thread Andrei Sereda
Hi all,

I have created a build for Apache Calcite 1.31.0, release
candidate 0.

Thanks to everyone who has contributed to this release.

You can read the release notes here:
https://github.com/apache/calcite/blob/calcite-1.31.0-rc0/site/_docs/history.md

The commit to be voted upon:
https://gitbox.apache.org/repos/asf?p=calcite.git;a=commit;h=c416e109460d8e439078206a48057b504b6bb08b

Its hash is c416e109460d8e439078206a48057b504b6bb08b

Tag:
https://gitbox.apache.org/repos/asf?p=calcite.git;a=tag;h=refs/tags/calcite-1.31.0-rc0

The artifacts to be voted on are located here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-1.31.0-rc0
(revision 55918)

The hashes of the artifacts are as follows:
527e699857958b9d98e733059bd67ca6fc42e75238074dec65cc86caa8f5ae176e269d9ac478754ad206ea2336289a8f40f37ee86818130b37b53a53ee79bb2c
*apache-calcite-1.31.0-src.tar.gz

A staged Maven repository is available for review at:
https://repository.apache.org/content/repositories/orgapachecalcite-1166/org/apache/calcite/

Release artifacts are signed with the following key:
https://people.apache.org/keys/committer/sereda.asc
https://www.apache.org/dist/calcite/KEYS

To create the jars and test Apache Calcite: "gradle build"
(requires an appropriate Gradle/JDK installation)

Please vote on releasing this package as Apache Calcite 1.31.0.

The vote is open for the next 72 hours and passes if a majority of at
least three +1 PMC votes are cast.

[ ] +1 Release this package as Apache Calcite 1.31.0
[ ]  0 I don't feel strongly about it, but I'm okay with the release
[ ] -1 Do not release this package because...

Here is my vote:

+1 (non-binding)


Re: [DISCUSS] Towards Calcite 1.31.0

2022-07-22 Thread Andrei Sereda
It should be all good now.

My problem was that I use different accounts for github and gitbox.

For some reason the gradle release plugin was using github credentials (
asfGitSourceUsername property) and not nexus ones (asfNexusUsername) from
~/.gradle/gradle.properties. Maybe because of the pushRepositoryProvider
override ?



On Fri, Jul 22, 2022 at 10:47 PM Andrei Sereda  wrote:

> Thanks, Julian. I did include GITBOX in the prepare vote command.
>
> $ gradle  prepareVote -Prc=0 -Pasf -Pasf.git.pushRepositoryProvider=GITBOX
>
>
>
> On Fri, Jul 22, 2022 at 1:31 PM Julian Hyde  wrote:
>
>> Andrei, Are you perhaps running into
>> https://issues.apache.org/jira/browse/CALCITE-4856 ?
>>
>> On Fri, Jul 22, 2022 at 7:36 AM Andrei Sereda  wrote:
>> >
>> > Quick update.
>> >
>> > I've addressed all comments in the release notes PR.
>> >
>> > While tagging RC0, I've run into small issue with apache gitbox
>> > authorization (see below) but should be able to solve them (I've
>> released
>> > 1.25 in the past without problems with the new gradle process)
>> >
>> >
>> > > Task :pushRcTag
>> > Pushing tag to Git remote release-origin:
>> > https://gitbox.apache.org/repos/asf/calcite.git
>> >
>> > > Task :pushRcTag FAILED
>> >
>> > Build calcite FAILURE reason:
>> > Execution failed for task ':pushRcTag':
>> >* Caused by: org.eclipse.jgit.api.errors.TransportException:
>> > https://gitbox.apache.org/repos/asf/calcite.git
>> > : not authorized*
>> > at
>> org.eclipse.jgit.api.PushCommand.call(PushCommand.java:180)
>> > at
>> >
>> com.github.vlsi.gradle.release.jgit.dsl.GitExtensionsKt.push(GitExtensions.kt:132)
>> > at
>> >
>> com.github.vlsi.gradle.release.GitPushTask$pushTag$1.invoke(GitPushTask.kt:54)
>> >
>> > On Thu, Jul 21, 2022 at 1:14 AM Andrei Sereda 
>> wrote:
>> >
>> > > Hi Julian,
>> > >
>> > > I think it is a great idea.
>> > >
>> > > Please take a look at proposed release notes:
>> > > https://github.com/apache/calcite/pull/2858
>> > >
>> > > Thanks,
>> > > Andrei.
>> > >
>> > >
>> > > On Wed, Jul 20, 2022 at 4:31 PM Julian Hyde 
>> > > wrote:
>> > >
>> > >> Andrei,
>> > >>
>> > >> One thing that has worked well is for the RM to create a PR with the
>> > >> release notes. People can then review the release notes, comment on
>> that
>> > >> PR, and add their own release notes. As RM you would not submit the
>> PR, but
>> > >> instead manually rebase onto the final RC.
>> > >>
>> > >> Julian
>> > >>
>> > >>
>> > >> > On Jul 19, 2022, at 6:44 PM, Andrei Sereda 
>> wrote:
>> > >> >
>> > >> > Hello,
>> > >> >
>> > >> > Anything specific you'd like to be added to the release notes of
>> 1.31 ?
>> > >> > If so, please provide a short summary as well as JIRA id.
>> > >> >
>> > >> >
>> > >> > Andrei.
>> > >> >
>> > >> > On Tue, Jul 12, 2022 at 10:07 PM Andrei Sereda 
>> > >> wrote:
>> > >> >
>> > >> >> Hi Julian,
>> > >> >>
>> > >> >>
>> > >> >>> Andrei, Are there any remaining blockers for 1.31?
>> > >> >> No blockers for 1.31. Any pending issues can be moved towards
>> 1.32.
>> > >> >>
>> > >> >>> Can we proceed with an RC0?
>> > >> >>
>> > >> >> Yes, I'll start the release very soon.
>> > >> >>
>> > >> >> Thanks for fixing the regression.
>> > >> >>
>> > >> >> Andrei.
>> > >> >>
>> > >> >>
>> > >> >> On Tue, Jul 12, 2022 at 4:35 PM Julian Hyde <
>> jhyde.apa...@gmail.com>
>> > >> >> wrote:
>> > >> >>
>> > >> >>> I merged https://issues.apache.org/jira/browse/CALCITE-5194 <
>> > >> >>> https://issues.apache.org/jira/browse/CALCITE-5194>, the fix
>> for the
>> > >> >>> regression due to
>> https://issues.apache.org/jira/browse/CALCITE-35 <
>> > >> >>> https://issues.apache.org/jira/browse/CALCITE-35>, yesterday.
>> > >> >>>
>> > >> >>> Andrei, Are there any remaining blockers for 1.31? Can we proceed
>> > >> with an
>> > >> >>> RC0?
>> > >> >>>
>> > >> >>> Julian
>> > >> >>>
>> > >> >>>
>> > >>  On Jun 21, 2022, at 11:29 PM, Yanjing Wang <
>> > >> zhuangzixiao...@gmail.com>
>> > >> >>> wrote:
>> > >> 
>> > >>  Thanks Andrei, now there is nobody to review these PRs, It's ok
>> to
>> > >> >>> change
>> > >>  to 1.32,I think pr-2838 <
>> https://github.com/apache/calcite/pull/2838
>> > >> >
>> > >> >>> for
>> > >>  CALCITE-5045 <
>> https://issues.apache.org/jira/browse/CALCITE-5045>
>> > >> >>> should be
>> > >>  merged before 1.31, because it's simple and Yingyu Wang
>> encountered
>> > >> >>> this
>> > >>  problem also.
>> > >> 
>> > >>  Andrei Sereda  于2022年6月22日周三 10:06写道:
>> > >> 
>> > >> > Julian, how much time do you think is necessary to fix
>> CALCITE-35
>> > >> > regression ?
>> > >> >
>> > >> > Yanjing, I see some discussions/attempts in JIRA/github to
>> review
>> > >> the
>> > >> >>> PRs.
>> > >> > Do you think it can still be reviewed and merged before 1.31 ?
>> > >> >
>> > >> > Viliam (and Julian), thanks for fixing (and merging)
>> CALC

Re: [DISCUSS] Towards Calcite 1.31.0

2022-07-22 Thread Andrei Sereda
Thanks, Julian. I did include GITBOX in the prepare vote command.

$ gradle  prepareVote -Prc=0 -Pasf -Pasf.git.pushRepositoryProvider=GITBOX



On Fri, Jul 22, 2022 at 1:31 PM Julian Hyde  wrote:

> Andrei, Are you perhaps running into
> https://issues.apache.org/jira/browse/CALCITE-4856 ?
>
> On Fri, Jul 22, 2022 at 7:36 AM Andrei Sereda  wrote:
> >
> > Quick update.
> >
> > I've addressed all comments in the release notes PR.
> >
> > While tagging RC0, I've run into small issue with apache gitbox
> > authorization (see below) but should be able to solve them (I've released
> > 1.25 in the past without problems with the new gradle process)
> >
> >
> > > Task :pushRcTag
> > Pushing tag to Git remote release-origin:
> > https://gitbox.apache.org/repos/asf/calcite.git
> >
> > > Task :pushRcTag FAILED
> >
> > Build calcite FAILURE reason:
> > Execution failed for task ':pushRcTag':
> >* Caused by: org.eclipse.jgit.api.errors.TransportException:
> > https://gitbox.apache.org/repos/asf/calcite.git
> > : not authorized*
> > at
> org.eclipse.jgit.api.PushCommand.call(PushCommand.java:180)
> > at
> >
> com.github.vlsi.gradle.release.jgit.dsl.GitExtensionsKt.push(GitExtensions.kt:132)
> > at
> >
> com.github.vlsi.gradle.release.GitPushTask$pushTag$1.invoke(GitPushTask.kt:54)
> >
> > On Thu, Jul 21, 2022 at 1:14 AM Andrei Sereda  wrote:
> >
> > > Hi Julian,
> > >
> > > I think it is a great idea.
> > >
> > > Please take a look at proposed release notes:
> > > https://github.com/apache/calcite/pull/2858
> > >
> > > Thanks,
> > > Andrei.
> > >
> > >
> > > On Wed, Jul 20, 2022 at 4:31 PM Julian Hyde 
> > > wrote:
> > >
> > >> Andrei,
> > >>
> > >> One thing that has worked well is for the RM to create a PR with the
> > >> release notes. People can then review the release notes, comment on
> that
> > >> PR, and add their own release notes. As RM you would not submit the
> PR, but
> > >> instead manually rebase onto the final RC.
> > >>
> > >> Julian
> > >>
> > >>
> > >> > On Jul 19, 2022, at 6:44 PM, Andrei Sereda 
> wrote:
> > >> >
> > >> > Hello,
> > >> >
> > >> > Anything specific you'd like to be added to the release notes of
> 1.31 ?
> > >> > If so, please provide a short summary as well as JIRA id.
> > >> >
> > >> >
> > >> > Andrei.
> > >> >
> > >> > On Tue, Jul 12, 2022 at 10:07 PM Andrei Sereda 
> > >> wrote:
> > >> >
> > >> >> Hi Julian,
> > >> >>
> > >> >>
> > >> >>> Andrei, Are there any remaining blockers for 1.31?
> > >> >> No blockers for 1.31. Any pending issues can be moved towards 1.32.
> > >> >>
> > >> >>> Can we proceed with an RC0?
> > >> >>
> > >> >> Yes, I'll start the release very soon.
> > >> >>
> > >> >> Thanks for fixing the regression.
> > >> >>
> > >> >> Andrei.
> > >> >>
> > >> >>
> > >> >> On Tue, Jul 12, 2022 at 4:35 PM Julian Hyde <
> jhyde.apa...@gmail.com>
> > >> >> wrote:
> > >> >>
> > >> >>> I merged https://issues.apache.org/jira/browse/CALCITE-5194 <
> > >> >>> https://issues.apache.org/jira/browse/CALCITE-5194>, the fix for
> the
> > >> >>> regression due to
> https://issues.apache.org/jira/browse/CALCITE-35 <
> > >> >>> https://issues.apache.org/jira/browse/CALCITE-35>, yesterday.
> > >> >>>
> > >> >>> Andrei, Are there any remaining blockers for 1.31? Can we proceed
> > >> with an
> > >> >>> RC0?
> > >> >>>
> > >> >>> Julian
> > >> >>>
> > >> >>>
> > >>  On Jun 21, 2022, at 11:29 PM, Yanjing Wang <
> > >> zhuangzixiao...@gmail.com>
> > >> >>> wrote:
> > >> 
> > >>  Thanks Andrei, now there is nobody to review these PRs, It's ok
> to
> > >> >>> change
> > >>  to 1.32,I think pr-2838 <
> https://github.com/apache/calcite/pull/2838
> > >> >
> > >> >>> for
> > >>  CALCITE-5045  >
> > >> >>> should be
> > >>  merged before 1.31, because it's simple and Yingyu Wang
> encountered
> > >> >>> this
> > >>  problem also.
> > >> 
> > >>  Andrei Sereda  于2022年6月22日周三 10:06写道:
> > >> 
> > >> > Julian, how much time do you think is necessary to fix
> CALCITE-35
> > >> > regression ?
> > >> >
> > >> > Yanjing, I see some discussions/attempts in JIRA/github to
> review
> > >> the
> > >> >>> PRs.
> > >> > Do you think it can still be reviewed and merged before 1.31 ?
> > >> >
> > >> > Viliam (and Julian), thanks for fixing (and merging)
> CALCITE-5157
> > >> >
> > >> > Dmitry (and Stamatis / Ruben), thanks for fixing (and merging)
> > >> > CALCITE-5134.
> > >> > As I understand CALCITE-5127 is delayed until 1.32 ?
> > >> >
> > >> >
> > >> >
> > >> > On Tue, Jun 21, 2022 at 2:57 AM Julian Hyde <
> jhyde.apa...@gmail.com
> > >> >
> > >> > wrote:
> > >> >
> > >> >> I agree that it’s a regression, and caused by my CALCITE-35
> change.
> > >> >>> I’ve
> > >> >> assigned the bug to myself. I’m not sure I have time to fix it
> this
> > >> >>>

Re: [Discuss] CommonSubExpressions Optimize

2022-07-22 Thread Julian Hyde
It would certainly be possible to write a planner rule that converts a Calc to 
a sequence of Project and an optional Filter.

However, it might not yield optimal performance. Consider this query:

  SELECT a AS x1,
a + b AS x2,
a + b + c AS x3,
a + b + c + d AS x4,
a + b + c + d + e AS x5
  FROM t

The depth of the DAG is 4, and therefore it would generate 4 Project operators: 
the first would compute “a + b” and project it as x2, the second would compute 
“a + b + c” using the intermediate result in x2 and project it as x3, and so 
forth.

In any practical DBMS the cost of returning a row from a Project operator will 
be much higher than the cost of a + operation, so this plan is not optimal.

To generate a plan with the fastest runtime performance, you will need to 
optimize with a utility function that knows the cost of each operator and also 
knows the cost of emitting a row from a Project. Or do as we did in Calcite, 
which is to have a physical implementation of Project that shares intermediate 
expressions.

Julian



> On Jul 16, 2022, at 6:24 PM, Benchao Li  wrote:
> 
> Hi Jiajun,
> 
> I'm thinking about using the optimization of Calc, but change CalcToSql.
> 
> Do you mean you want to translate the above query to this one?
> ```SQL
> SELECT "salary", EXPR$1, EXPR$0, EXPR$2, EXPR$2
> FROM (
>  SELECT "salary", EXPR$0, EXPR$1, EXPR$0 + EXPR$1 AS EXPR$2
>  FROM (
>SELECT "salary", "salary" * 3 AS EXPR$0, "salary" * 12 AS EXPR$1
>FROM "hr"."emps"
>  )
> )
> ```
> If this is your intended way, I think you may need to figure out whether
> Trino
> will merge these projections in the first place.
> Even Trino could leverage the nested projections, you may still meet some
> complex expression trees which are very deep, I don't think this is a good
> solution.
> Maybe the best way is to make Trino support this natively.
> 
> 
> Jiajun Xie  于2022年7月16日周六 16:51写道:
> 
>> Yes, you are both correct.
>> 
>> I got an expected plan by using ProjectToCalcRule
>> ```
>> PLAN=EnumerableCalc(expr#0..4=[{inputs}], expr#5=[12], expr#6=[*($t5,
>> $t3)], expr#7=[3], expr#8=[*($t7, $t3)], expr#9=[*($t3, $t5)],
>> expr#10=[*($t3, $t7)], expr#11=[+($t9, $t10)], salary=[$t3], EXPR$1=[$t6],
>> EXPR$2=[$t8], EXPR$3=[$t11], EXPR$4=[$t11])\n
>> EnumerableTableScan(table=[[hr, emps]])\n\n
>> ```
>> 
>> But I got an unexpected  query when using RelToSql. I hope to extract
>> CommonSubExpressions in SQL, because Trino does not support
>> CommonSubExpressions optimization. (Presto supports it since 0.245).
>> ```
>> SELECT "salary", 12 * "salary", 3 * "salary", "salary" * 12 + "salary" * 3,
>> "salary" * 12 + "salary" * 3
>> FROM "hr"."emps"
>> ```
>> 
>> I'm thinking about using the optimization of Calc, but change CalcToSql.
>> What do you think?
>> FYI: In my project, I convert HiveSQL to PrestoSQL, and use some
>> optimizations of Calcite.
>> 
>> Thanks for your reply!
>> 
>> On Fri, 15 Jul 2022 at 09:44, Benchao Li  wrote:
>> 
>>> Agree with Julian, RexProgram could do this work.
>>> 
>>> I did this before in physical codegen based on Calc's RexProgram, and it
>>> works very well.
>>> 
>>> Julian Hyde  于2022年7月14日周四 23:21写道:
>>> 
 It seems that you are tackling common scalar expressions (RexNodes)
 whereas, based on the name the other rule is dealing with common
>>> relational
 expressions (RelNode).
 
 For your rule, consider using RexProgram, RexProgramBuilder, and Calc.
 They already convert a list of expressions to a DAG, so that no
>>> expression
 is calculated more than once.
 
 Julian
 
> On Jul 14, 2022, at 06:31, Jiajun Xie 
>>> wrote:
> 
> Hello, all~
> I am writing an RelOptRule that is for CommonSubExpressions. Here is
>>> an
> example that I completed.
>   sql:  `select sal, sal * 12, sal * 3, sal * 12 + sal * 3 from emp`
>   planBefore: ```LogicalProject(SAL=[$5], EXPR$1=[*($5, 12)],
> EXPR$2=[*($5, 3)], EXPR$3=[+(*($5, 12), *($5, 3))])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]])```
>   planAfter: ```LogicalProject(SAL=[$0], EXPR$1=[$1], EXPR$2=[$2],
> EXPR$3=[+($1, $2)])
> LogicalProject(SAL=[$5], CSE$0=[*($5, 12)], CSE$1=[*($5, 3)])
>  LogicalTableScan(table=[[CATALOG, SALES, EMP]])```
> I found a RelOptRule that is named as CommonRelSubExprRule, but it
>> is
> abstract. I wonder if anyone has implemented it? Is it the same as
>>> what I
> am doing?
> Thanks very much~
 
>>> 
>>> 
>>> --
>>> 
>>> Best,
>>> Benchao Li
>>> 
>> 
> 
> 
> -- 
> 
> Best,
> Benchao Li



Re: [DISCUSS] Towards Calcite 1.31.0

2022-07-22 Thread Julian Hyde
Andrei, Are you perhaps running into
https://issues.apache.org/jira/browse/CALCITE-4856 ?

On Fri, Jul 22, 2022 at 7:36 AM Andrei Sereda  wrote:
>
> Quick update.
>
> I've addressed all comments in the release notes PR.
>
> While tagging RC0, I've run into small issue with apache gitbox
> authorization (see below) but should be able to solve them (I've released
> 1.25 in the past without problems with the new gradle process)
>
>
> > Task :pushRcTag
> Pushing tag to Git remote release-origin:
> https://gitbox.apache.org/repos/asf/calcite.git
>
> > Task :pushRcTag FAILED
>
> Build calcite FAILURE reason:
> Execution failed for task ':pushRcTag':
>* Caused by: org.eclipse.jgit.api.errors.TransportException:
> https://gitbox.apache.org/repos/asf/calcite.git
> : not authorized*
> at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:180)
> at
> com.github.vlsi.gradle.release.jgit.dsl.GitExtensionsKt.push(GitExtensions.kt:132)
> at
> com.github.vlsi.gradle.release.GitPushTask$pushTag$1.invoke(GitPushTask.kt:54)
>
> On Thu, Jul 21, 2022 at 1:14 AM Andrei Sereda  wrote:
>
> > Hi Julian,
> >
> > I think it is a great idea.
> >
> > Please take a look at proposed release notes:
> > https://github.com/apache/calcite/pull/2858
> >
> > Thanks,
> > Andrei.
> >
> >
> > On Wed, Jul 20, 2022 at 4:31 PM Julian Hyde 
> > wrote:
> >
> >> Andrei,
> >>
> >> One thing that has worked well is for the RM to create a PR with the
> >> release notes. People can then review the release notes, comment on that
> >> PR, and add their own release notes. As RM you would not submit the PR, but
> >> instead manually rebase onto the final RC.
> >>
> >> Julian
> >>
> >>
> >> > On Jul 19, 2022, at 6:44 PM, Andrei Sereda  wrote:
> >> >
> >> > Hello,
> >> >
> >> > Anything specific you'd like to be added to the release notes of 1.31 ?
> >> > If so, please provide a short summary as well as JIRA id.
> >> >
> >> >
> >> > Andrei.
> >> >
> >> > On Tue, Jul 12, 2022 at 10:07 PM Andrei Sereda 
> >> wrote:
> >> >
> >> >> Hi Julian,
> >> >>
> >> >>
> >> >>> Andrei, Are there any remaining blockers for 1.31?
> >> >> No blockers for 1.31. Any pending issues can be moved towards 1.32.
> >> >>
> >> >>> Can we proceed with an RC0?
> >> >>
> >> >> Yes, I'll start the release very soon.
> >> >>
> >> >> Thanks for fixing the regression.
> >> >>
> >> >> Andrei.
> >> >>
> >> >>
> >> >> On Tue, Jul 12, 2022 at 4:35 PM Julian Hyde 
> >> >> wrote:
> >> >>
> >> >>> I merged https://issues.apache.org/jira/browse/CALCITE-5194 <
> >> >>> https://issues.apache.org/jira/browse/CALCITE-5194>, the fix for the
> >> >>> regression due to https://issues.apache.org/jira/browse/CALCITE-35 <
> >> >>> https://issues.apache.org/jira/browse/CALCITE-35>, yesterday.
> >> >>>
> >> >>> Andrei, Are there any remaining blockers for 1.31? Can we proceed
> >> with an
> >> >>> RC0?
> >> >>>
> >> >>> Julian
> >> >>>
> >> >>>
> >>  On Jun 21, 2022, at 11:29 PM, Yanjing Wang <
> >> zhuangzixiao...@gmail.com>
> >> >>> wrote:
> >> 
> >>  Thanks Andrei, now there is nobody to review these PRs, It's ok to
> >> >>> change
> >>  to 1.32,I think pr-2838  >> >
> >> >>> for
> >>  CALCITE-5045 
> >> >>> should be
> >>  merged before 1.31, because it's simple and Yingyu Wang  encountered
> >> >>> this
> >>  problem also.
> >> 
> >>  Andrei Sereda  于2022年6月22日周三 10:06写道:
> >> 
> >> > Julian, how much time do you think is necessary to fix CALCITE-35
> >> > regression ?
> >> >
> >> > Yanjing, I see some discussions/attempts in JIRA/github to review
> >> the
> >> >>> PRs.
> >> > Do you think it can still be reviewed and merged before 1.31 ?
> >> >
> >> > Viliam (and Julian), thanks for fixing (and merging) CALCITE-5157
> >> >
> >> > Dmitry (and Stamatis / Ruben), thanks for fixing (and merging)
> >> > CALCITE-5134.
> >> > As I understand CALCITE-5127 is delayed until 1.32 ?
> >> >
> >> >
> >> >
> >> > On Tue, Jun 21, 2022 at 2:57 AM Julian Hyde  >> >
> >> > wrote:
> >> >
> >> >> I agree that it’s a regression, and caused by my CALCITE-35 change.
> >> >>> I’ve
> >> >> assigned the bug to myself. I’m not sure I have time to fix it this
> >> >>> week,
> >> >> so we can back out my change if necessary to get the release out on
> >> >> schedule. If someone else can fix it I would be grateful.
> >> >>
> >> >>
> >> >>> On Jun 19, 2022, at 2:26 AM, Vova Vysotskyi  >> >
> >> >> wrote:
> >> >>>
> >> >>> Hello,
> >> >>>
> >> >>> I have found the following regression while verifying the new
> >> release
> >> > to
> >> >> work with Apache Drill:
> >> > https://issues.apache.org/jira/browse/CALCITE-5194
> >> >> .
> >> >>> This issue appeared after changes f

Re: Serializing parsed SqlNode/AST

2022-07-22 Thread Julian Hyde
I don’t know of any such facility. I suppose someone could do for AST trees
what RelJson and RelWriterTest do for RelNode trees.

Can you please log a Jira case for this? It’s good to have a placeholder in
case someone feels like picking it up in future.

Julian

[1]
https://github.com/apache/calcite/blob/HEAD/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
[2]
https://github.com/apache/calcite/blob/HEAD/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java


On Jul 21, 2022, at 5:36 AM, Parag Jain  wrote:

Hello,

We are using calcite in our project to parse and manipulate SQL. We have
also extended the parser for our use case.

Now, we would like to serialize the parsed SqlNode with type information
and pass it to a different system over wire for query intelligence. We were
thinking of using protobuf for this, I was wondering if anyone has already
done similar work or thought about a good approach to achieve serialization
of a parsed query.

Thanks


Re: [DISCUSS] Towards Calcite 1.31.0

2022-07-22 Thread Andrei Sereda
Quick update.

I've addressed all comments in the release notes PR.

While tagging RC0, I've run into small issue with apache gitbox
authorization (see below) but should be able to solve them (I've released
1.25 in the past without problems with the new gradle process)


> Task :pushRcTag
Pushing tag to Git remote release-origin:
https://gitbox.apache.org/repos/asf/calcite.git

> Task :pushRcTag FAILED

Build calcite FAILURE reason:
Execution failed for task ':pushRcTag':
   * Caused by: org.eclipse.jgit.api.errors.TransportException:
https://gitbox.apache.org/repos/asf/calcite.git
: not authorized*
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:180)
at
com.github.vlsi.gradle.release.jgit.dsl.GitExtensionsKt.push(GitExtensions.kt:132)
at
com.github.vlsi.gradle.release.GitPushTask$pushTag$1.invoke(GitPushTask.kt:54)

On Thu, Jul 21, 2022 at 1:14 AM Andrei Sereda  wrote:

> Hi Julian,
>
> I think it is a great idea.
>
> Please take a look at proposed release notes:
> https://github.com/apache/calcite/pull/2858
>
> Thanks,
> Andrei.
>
>
> On Wed, Jul 20, 2022 at 4:31 PM Julian Hyde 
> wrote:
>
>> Andrei,
>>
>> One thing that has worked well is for the RM to create a PR with the
>> release notes. People can then review the release notes, comment on that
>> PR, and add their own release notes. As RM you would not submit the PR, but
>> instead manually rebase onto the final RC.
>>
>> Julian
>>
>>
>> > On Jul 19, 2022, at 6:44 PM, Andrei Sereda  wrote:
>> >
>> > Hello,
>> >
>> > Anything specific you'd like to be added to the release notes of 1.31 ?
>> > If so, please provide a short summary as well as JIRA id.
>> >
>> >
>> > Andrei.
>> >
>> > On Tue, Jul 12, 2022 at 10:07 PM Andrei Sereda 
>> wrote:
>> >
>> >> Hi Julian,
>> >>
>> >>
>> >>> Andrei, Are there any remaining blockers for 1.31?
>> >> No blockers for 1.31. Any pending issues can be moved towards 1.32.
>> >>
>> >>> Can we proceed with an RC0?
>> >>
>> >> Yes, I'll start the release very soon.
>> >>
>> >> Thanks for fixing the regression.
>> >>
>> >> Andrei.
>> >>
>> >>
>> >> On Tue, Jul 12, 2022 at 4:35 PM Julian Hyde 
>> >> wrote:
>> >>
>> >>> I merged https://issues.apache.org/jira/browse/CALCITE-5194 <
>> >>> https://issues.apache.org/jira/browse/CALCITE-5194>, the fix for the
>> >>> regression due to https://issues.apache.org/jira/browse/CALCITE-35 <
>> >>> https://issues.apache.org/jira/browse/CALCITE-35>, yesterday.
>> >>>
>> >>> Andrei, Are there any remaining blockers for 1.31? Can we proceed
>> with an
>> >>> RC0?
>> >>>
>> >>> Julian
>> >>>
>> >>>
>>  On Jun 21, 2022, at 11:29 PM, Yanjing Wang <
>> zhuangzixiao...@gmail.com>
>> >>> wrote:
>> 
>>  Thanks Andrei, now there is nobody to review these PRs, It's ok to
>> >>> change
>>  to 1.32,I think pr-2838 > >
>> >>> for
>>  CALCITE-5045 
>> >>> should be
>>  merged before 1.31, because it's simple and Yingyu Wang  encountered
>> >>> this
>>  problem also.
>> 
>>  Andrei Sereda  于2022年6月22日周三 10:06写道:
>> 
>> > Julian, how much time do you think is necessary to fix CALCITE-35
>> > regression ?
>> >
>> > Yanjing, I see some discussions/attempts in JIRA/github to review
>> the
>> >>> PRs.
>> > Do you think it can still be reviewed and merged before 1.31 ?
>> >
>> > Viliam (and Julian), thanks for fixing (and merging) CALCITE-5157
>> >
>> > Dmitry (and Stamatis / Ruben), thanks for fixing (and merging)
>> > CALCITE-5134.
>> > As I understand CALCITE-5127 is delayed until 1.32 ?
>> >
>> >
>> >
>> > On Tue, Jun 21, 2022 at 2:57 AM Julian Hyde > >
>> > wrote:
>> >
>> >> I agree that it’s a regression, and caused by my CALCITE-35 change.
>> >>> I’ve
>> >> assigned the bug to myself. I’m not sure I have time to fix it this
>> >>> week,
>> >> so we can back out my change if necessary to get the release out on
>> >> schedule. If someone else can fix it I would be grateful.
>> >>
>> >>
>> >>> On Jun 19, 2022, at 2:26 AM, Vova Vysotskyi > >
>> >> wrote:
>> >>>
>> >>> Hello,
>> >>>
>> >>> I have found the following regression while verifying the new
>> release
>> > to
>> >> work with Apache Drill:
>> > https://issues.apache.org/jira/browse/CALCITE-5194
>> >> .
>> >>> This issue appeared after changes for
>> >> https://issues.apache.org/jira/browse/CALCITE-35.
>> >>> Since it is a regression, I suggest treating it as a blocker for
>> the
>> >> upcoming release.
>> >>>
>> >>> Kind regards,
>> >>> Volodymyr Vysotskyi
>> >>>
>> >>> On 2022/06/16 06:38:45 Viliam Durina wrote:
>>  I'll try to work on comments in CALCITE-5157
>>   today
>> >>>