Re: [ANNOUNCE] Andrei Sereda joins Calcite PMC

2022-08-12 Thread Francis Chuang

Congratulations Andrei!

On 13/08/2022 5:29 am, Michael Mior wrote:

Congratulations and welcome Andrei!

--
Michael Mior
mm...@apache.org


On Fri, Aug 12, 2022 at 1:48 PM Ruben Q L  wrote:


I am pleased to announce that Andrei has accepted an invitation to join
the Calcite PMC. Andrei has been a consistent and helpful figure in
the Calcite community for which we are very grateful. We look forward to
the continued contributions and support.

Please join me in congratulating Andrei!

Ruben (on behalf of the Calcite PMC)





Re: [ANNOUNCE] Andrei Sereda joins Calcite PMC

2022-08-12 Thread Haisheng Yuan
Congratulations, Andrei!

On 2022/08/12 19:29:56 Michael Mior wrote:
> Congratulations and welcome Andrei!
> 
> --
> Michael Mior
> mm...@apache.org
> 
> 
> On Fri, Aug 12, 2022 at 1:48 PM Ruben Q L  wrote:
> 
> > I am pleased to announce that Andrei has accepted an invitation to join
> > the Calcite PMC. Andrei has been a consistent and helpful figure in
> > the Calcite community for which we are very grateful. We look forward to
> > the continued contributions and support.
> >
> > Please join me in congratulating Andrei!
> >
> > Ruben (on behalf of the Calcite PMC)
> >
> 


Re: Why RexUtil.toCnf() has version that takes a limit but RexUtil.toDnf() doesn't ?

2022-08-12 Thread Yingyu Wang
Thanks! I'll create a Jira for this and PR accordingly.

Yingyu Wang

On Fri, Aug 12, 2022 at 7:00 PM Julian Hyde  wrote:

> Git blame reveals that that line of code was added when fixing
> https://issues.apache.org/jira/browse/CALCITE-1290 <
> https://issues.apache.org/jira/browse/CALCITE-1290>.
> https://github.com/apache/calcite/commit/77315c06 <
> https://github.com/apache/calcite/commit/77315c06>.
>
> I see no reason why toDnf shouldn’t have the same parameter. See if you
> can make the code similar.
>
> Julian
>
>
>
> > On Aug 12, 2022, at 12:58 PM, Yingyu Wang  wrote:
> >
> > Does anyone know why RexUtil.toCnf() has a version of the method that
> takes
> > a limit arg: toCnf(RexBuilder rexBuilder, int maxCnfNodeCount, RexNode
> rex),
> > but there is no such version for RexUtil.toDnf()?
> > Is there any special reason for this?
> > Can we add a similar version for RexUtil.toDnf() then?
>
>


Re: Why RexUtil.toCnf() has version that takes a limit but RexUtil.toDnf() doesn't ?

2022-08-12 Thread Julian Hyde
Git blame reveals that that line of code was added when fixing 
https://issues.apache.org/jira/browse/CALCITE-1290 
. 
https://github.com/apache/calcite/commit/77315c06 
.

I see no reason why toDnf shouldn’t have the same parameter. See if you can 
make the code similar.

Julian



> On Aug 12, 2022, at 12:58 PM, Yingyu Wang  wrote:
> 
> Does anyone know why RexUtil.toCnf() has a version of the method that takes
> a limit arg: toCnf(RexBuilder rexBuilder, int maxCnfNodeCount, RexNode rex),
> but there is no such version for RexUtil.toDnf()?
> Is there any special reason for this?
> Can we add a similar version for RexUtil.toDnf() then?



Why RexUtil.toCnf() has version that takes a limit but RexUtil.toDnf() doesn't ?

2022-08-12 Thread Yingyu Wang
Does anyone know why RexUtil.toCnf() has a version of the method that takes
a limit arg: toCnf(RexBuilder rexBuilder, int maxCnfNodeCount, RexNode rex),
but there is no such version for RexUtil.toDnf()?
Is there any special reason for this?
Can we add a similar version for RexUtil.toDnf() then?


Re: [ANNOUNCE] Andrei Sereda joins Calcite PMC

2022-08-12 Thread Michael Mior
Congratulations and welcome Andrei!

--
Michael Mior
mm...@apache.org


On Fri, Aug 12, 2022 at 1:48 PM Ruben Q L  wrote:

> I am pleased to announce that Andrei has accepted an invitation to join
> the Calcite PMC. Andrei has been a consistent and helpful figure in
> the Calcite community for which we are very grateful. We look forward to
> the continued contributions and support.
>
> Please join me in congratulating Andrei!
>
> Ruben (on behalf of the Calcite PMC)
>


Firebolt Dialect

2022-08-12 Thread Aymeric Dispa
Hi,

I am a software engineer at Firebolt and I need to make a few changes in
the Firebolt dialect. Could someone have a look at my PR
https://issues.apache.org/jira/browse/CALCITE-5217 /
https://github.com/apache/calcite/pull/2860 ?

Thanks !


Re: [ANNOUNCE] Andrei Sereda joins Calcite PMC

2022-08-12 Thread Julian Hyde
Congratulations and welcome, Andrei! Thank you for your service to the
Calcite community.

Julian


On Aug 12, 2022, at 10:47 AM, Ruben Q L  wrote:

I am pleased to announce that Andrei has accepted an invitation to join
the Calcite PMC. Andrei has been a consistent and helpful figure in
the Calcite community for which we are very grateful. We look forward to
the continued contributions and support.

Please join me in congratulating Andrei!

Ruben (on behalf of the Calcite PMC)


[ANNOUNCE] Andrei Sereda joins Calcite PMC

2022-08-12 Thread Ruben Q L
I am pleased to announce that Andrei has accepted an invitation to join
the Calcite PMC. Andrei has been a consistent and helpful figure in
the Calcite community for which we are very grateful. We look forward to
the continued contributions and support.

Please join me in congratulating Andrei!

Ruben (on behalf of the Calcite PMC)


Re: Problem with char type after upgrading from 1.30.0 to 1.31.0

2022-08-12 Thread Julian Hyde
+1 to running your private test suite on RCs.

I guess no one thinks they are using a project in an ‘unconventional way’, so 
let’s expand on that a little. If you run into a bug that no one else has seen, 
that’s an indication that using Calcite differently than other people. (Nothing 
wrong with that, by the way. It’s exciting when people apply Calcite to new 
problems!) Please log the bug, but also take the time to review the tests in 
that area, and write and contribute additional tests if necessary. During that 
testing, you may or may not find additional bugs. It’s good for both you and us 
that you discover bugs early.

Julian


> On Aug 12, 2022, at 10:30 AM, Ruben Q L  wrote:
> 
> Following Julian's comment, may I add: if your organization is using
> Calcite in an unconventional way, it is really helpful for the community to
> participate in the release vote process, so that we can spot any issue with
> a RC as soon as possible, in order to avoid rolling out releases with
> potential regressions.
> 
> Best,
> Ruben
> 
> 
> On Fri, Aug 12, 2022 at 5:40 PM Julian Hyde  wrote:
> 
>> I don’t know whether we ever officially supported the Java ‘char’ type.
>> It’s worth checking whether there are any tests for it.
>> 
>> More generally: if your organization is using Calcite in an unconventional
>> way, consider writing some tests for that area of functionality and
>> contributing them. You will be helping yourself and Calcite.
>> 
>> Julian
>> 
>> 
>>> On Aug 12, 2022, at 7:06 AM, Ruben Q L  wrote:
>>> 
>>> Hello Dmitry,
>>> 
>>> At first glance, it looks like a regression. Could you please create a
>> Jira
>>> ticket (ideally with a unit test that runs fine 1.30 but fails in 1.31)?
>>> 
>>> Best,
>>> Ruben
>>> 
>>> 
>>> On Fri, Aug 12, 2022 at 2:48 PM Dmitry Sysolyatin <
>> dm.sysolya...@gmail.com>
>>> wrote:
>>> 
 Hi!
 I have a problem with char data type after upgrading from 1.30 to 1.31.
>> I
 tried to execute a simple query "SELECT c.relkind FROM
>> pg_catalog.pg_class
 c" (relkind is JavaType(char) NOT NULL) and got an exception:
 
 Unable to implement EnumerableCalc(expr#0..32=[{inputs}],
>> relkind=[$t16]):
 rowcount = 100.0, cumulative cost = {200.0 rows, 3501.0 cpu, 0.0 io},
>> id =
 28
 EnumerableTableScan(table=[[default, pg_catalog, pg_class]]): rowcount
>> =
 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 19
 
 Suppressed: java.lang.RuntimeException: while resolving method
 'toChar[class java.lang.Object]' in class class
 org.apache.calcite.runtime.SqlFunctions
 at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:318)
 at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:448)
 at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:460)
 
 Queries with char literal work OK: "SELECT 'r';"
 Does someone have an idea what can be wrong ?
 
>> 
>> 



Re: Problem with char type after upgrading from 1.30.0 to 1.31.0

2022-08-12 Thread Ruben Q L
Following Julian's comment, may I add: if your organization is using
Calcite in an unconventional way, it is really helpful for the community to
participate in the release vote process, so that we can spot any issue with
a RC as soon as possible, in order to avoid rolling out releases with
potential regressions.

Best,
Ruben


On Fri, Aug 12, 2022 at 5:40 PM Julian Hyde  wrote:

> I don’t know whether we ever officially supported the Java ‘char’ type.
> It’s worth checking whether there are any tests for it.
>
> More generally: if your organization is using Calcite in an unconventional
> way, consider writing some tests for that area of functionality and
> contributing them. You will be helping yourself and Calcite.
>
> Julian
>
>
> > On Aug 12, 2022, at 7:06 AM, Ruben Q L  wrote:
> >
> > Hello Dmitry,
> >
> > At first glance, it looks like a regression. Could you please create a
> Jira
> > ticket (ideally with a unit test that runs fine 1.30 but fails in 1.31)?
> >
> > Best,
> > Ruben
> >
> >
> > On Fri, Aug 12, 2022 at 2:48 PM Dmitry Sysolyatin <
> dm.sysolya...@gmail.com>
> > wrote:
> >
> >> Hi!
> >> I have a problem with char data type after upgrading from 1.30 to 1.31.
> I
> >> tried to execute a simple query "SELECT c.relkind FROM
> pg_catalog.pg_class
> >> c" (relkind is JavaType(char) NOT NULL) and got an exception:
> >>
> >> Unable to implement EnumerableCalc(expr#0..32=[{inputs}],
> relkind=[$t16]):
> >> rowcount = 100.0, cumulative cost = {200.0 rows, 3501.0 cpu, 0.0 io},
> id =
> >> 28
> >>  EnumerableTableScan(table=[[default, pg_catalog, pg_class]]): rowcount
> =
> >> 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 19
> >>
> >> Suppressed: java.lang.RuntimeException: while resolving method
> >> 'toChar[class java.lang.Object]' in class class
> >> org.apache.calcite.runtime.SqlFunctions
> >> at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:318)
> >> at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:448)
> >> at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:460)
> >>
> >> Queries with char literal work OK: "SELECT 'r';"
> >> Does someone have an idea what can be wrong ?
> >>
>
>


Re: Technical Queries Regarding Pushing Down Joins & Unions To TableScans, Conventions

2022-08-12 Thread Pranav Deshpande
HI Benchao,
Thank you very much for your excellent suggestions!

I believe that I have a better understanding about my problem now. I saw
the pushdowns and also the usage of multiple conventions in the same plan,
and was able to implement and play around with the same.

I went through talk [4] as well.

So my question is better phrased as: "Is there a planner rule that converts
a join on 2 Table scans to some kind of table?" Are any examples
available on this? I tried looking for examples on the same, however; I was
able to observe pushdowns, but not what I just mentioned.

This is similar to the ProjectTableScan rule in some sense, it converts a
project on a TableScan to a ProjectableFilterableTable SCAN.

Thanks & Regards,
Pranav

On Fri, Aug 5, 2022 at 11:57 PM Benchao Li  wrote:

> Pranav,
>
> You can reference Calcite adaptors implementation, such as JDBC
> Adaptor[1], MongoDB Adaptor[2].
> Their implementation allows pushing down operations (RelNode) to the
> adapter as much as possible, and the left RelNodes will be implemented
> using Enumerable Convention.
>
> We have a Converter[3] concept which makes this possible. The converter
> node allows multiple Conventions in a single query. This also answers your
> second question.
> There is a talk[4] about this, it's very helpful for understanding this
> concept.
>
> [1]
> https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverter.java
> [2]
> https://github.com/apache/calcite/blob/main/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoToEnumerableConverter.java
> [3]
> https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/convert/Converter.java
> [4]
> https://calcite.apache.org/community/#fast-federated-sql-with-apache-calcite
>
> Julian Hyde  于2022年8月6日周六 02:06写道:
>
>> Pranav,
>>
>> Please subscribe to this list. You have asked several questions, received
>> replies, not acknowledged those replies, and asked further questions. Also,
>> since you are not subscribed, each email you post has to go through manual
>> moderation.
>>
>> Julian
>>
>> > On Aug 5, 2022, at 9:38 AM, Pranav Deshpande <
>> deshpande.v.pra...@gmail.com> wrote:
>> >
>> > Dear Apache Calcite Team,
>> > I have 2 questions.
>> >
>> > -
>> > 1.
>> >
>> > There are plenty of examples on how to push down projects and filters
>> into
>> > the leaf nodes (tablescans).
>> >
>> > However, I could not find any examples to push down joins to TableScans
>> (or
>> > joins+filters+projects etc.) [this is helpful for data federation I
>> think].
>> >
>> > On the mailing list, many folks are suggesting that I use Drill.
>> However,
>> > the purpose of my exercise is to gain knowledge about DBMS and Query
>> > processing etc.
>> >
>> > I tried debugging open source engines that use Calcite (Drill, Druid,
>> Trino
>> > etc.) but was completely lost.
>> >
>> > Any examples/pointers/guidance around the same would be appreciated.
>> > Example, pushing down a join with a filter to a DBMS(consider jdbc
>> > msql etc.)
>> >
>> > -
>> > 2.
>> >
>> > The 2nd question I have is regarding conventions and different DBMS. The
>> > cluster has a method to replace the trait convention(Bindable,JDBC
>> etc.),
>> > and then we optimize and get the physical plan.
>> >
>> > But imagine I have both the MYSQL JDBC convnction and a cassandra
>> > convention and some user is trying to query both tables.
>> >
>> > Something like "SELECT users.username, specialdata.country from
>> > cassandraDB.user join mysqlDB.specialdata ON users.id
>> =specialdata.userid"
>> >
>> > Now, how will calcite do the optimization here? The planner is not
>> > accepting 2 different conventions.
>> >
>> > Thanks & Regards,
>> > Pranav
>>
>>
>
> --
>
> Best,
> Benchao Li
>


Re: Technical Queries Regarding Pushing Down Joins & Unions To TableScans, Conventions

2022-08-12 Thread Pranav Deshpande
Hi Stamatis,
Their documentation mentions that it is only for Apache contributors.
Hence, I am unable to find a way to reply to the posts I made before I
subscribed to the mailing list.

Regards,
Pranav

On Mon, Aug 8, 2022 at 4:56 AM Stamatis Zampetakis 
wrote:

> Hi Pranav,
>
> One way to reply to existing threads is to go to the Pony Mail service [1],
> click on the appropriate thread, hit the reply button, and follow the
> instructions there.
>
> Best,
> Stamatis
>
> [1] https://lists.apache.org/list.html?dev@calcite.apache.org
>
> On Sun, Aug 7, 2022 at 5:16 AM Jiajun Xie 
> wrote:
>
> > Hi, Pranav,
> >   You can send an email to dev-subscr...@calcite.apache.org to
> subscribe.
> >
> >   Actually, This way is listed in https://calcite.apache.org/community/
> >
> >
> >
> > On Sat, 6 Aug 2022 at 23:02, Pranav Deshpande <
> > deshpande.v.pra...@gmail.com>
> > wrote:
> >
> > > Hi Julian,
> > > I apologize for the same.
> > >
> > > It was not my intention to do so. I very much wanted to acknowledge the
> > > replies, however, I could not do so as mentioned on my 2nd post:
> > > https://lists.apache.org/thread/27v6pymkm8qfxfkrf2pojl8w1bpmjwzc (I
> > asked
> > > for instructions on replying back to the mailing list on this as well).
> > >
> > > Failing to get a reply for that, I had to send emails to the mailing
> list
> > > again (I tried subscribing but the system is demanding some kind of SSO
> > > login).
> > >
> > > Could you please tell me how to subscribe? I will then reply to the
> > > particular queries I had on each post.
> > >
> > > Thanks & Regards,
> > > Pranav
> > >
> > >
> > >
> > >
> > >
> > > On Fri, Aug 5, 2022, 2:06 PM Julian Hyde 
> wrote:
> > >
> > > > Pranav,
> > > >
> > > > Please subscribe to this list. You have asked several questions,
> > received
> > > > replies, not acknowledged those replies, and asked further questions.
> > > Also,
> > > > since you are not subscribed, each email you post has to go through
> > > manual
> > > > moderation.
> > > >
> > > > Julian
> > > >
> > > > > On Aug 5, 2022, at 9:38 AM, Pranav Deshpande <
> > > > deshpande.v.pra...@gmail.com> wrote:
> > > > >
> > > > > Dear Apache Calcite Team,
> > > > > I have 2 questions.
> > > > >
> > > > > -
> > > > > 1.
> > > > >
> > > > > There are plenty of examples on how to push down projects and
> filters
> > > > into
> > > > > the leaf nodes (tablescans).
> > > > >
> > > > > However, I could not find any examples to push down joins to
> > TableScans
> > > > (or
> > > > > joins+filters+projects etc.) [this is helpful for data federation I
> > > > think].
> > > > >
> > > > > On the mailing list, many folks are suggesting that I use Drill.
> > > However,
> > > > > the purpose of my exercise is to gain knowledge about DBMS and
> Query
> > > > > processing etc.
> > > > >
> > > > > I tried debugging open source engines that use Calcite (Drill,
> Druid,
> > > > Trino
> > > > > etc.) but was completely lost.
> > > > >
> > > > > Any examples/pointers/guidance around the same would be
> appreciated.
> > > > > Example, pushing down a join with a filter to a DBMS(consider jdbc
> > > > > msql etc.)
> > > > >
> > > > > -
> > > > > 2.
> > > > >
> > > > > The 2nd question I have is regarding conventions and different
> DBMS.
> > > The
> > > > > cluster has a method to replace the trait convention(Bindable,JDBC
> > > etc.),
> > > > > and then we optimize and get the physical plan.
> > > > >
> > > > > But imagine I have both the MYSQL JDBC convnction and a cassandra
> > > > > convention and some user is trying to query both tables.
> > > > >
> > > > > Something like "SELECT users.username, specialdata.country from
> > > > > cassandraDB.user join mysqlDB.specialdata ON users.id
> > > > =specialdata.userid"
> > > > >
> > > > > Now, how will calcite do the optimization here? The planner is not
> > > > > accepting 2 different conventions.
> > > > >
> > > > > Thanks & Regards,
> > > > > Pranav
> > > >
> > > >
> > >
> >
>


Re: Technical Queries Regarding Pushing Down Joins & Unions To TableScans, Conventions

2022-08-12 Thread Pranav Deshpande
Hi Jiajun Xie,
I was able to subscribe and am now able to reply on various threads.

However, I am still not able to reply on the past threads I created before
I subscribed.

Is there any way to do the same?

Thanks & Regards,
Pranav

On Sat, Aug 6, 2022 at 10:17 PM Jiajun Xie 
wrote:

> Hi, Pranav,
>   You can send an email to dev-subscr...@calcite.apache.org to subscribe.
>
>   Actually, This way is listed in https://calcite.apache.org/community/
>
>
>
> On Sat, 6 Aug 2022 at 23:02, Pranav Deshpande <
> deshpande.v.pra...@gmail.com>
> wrote:
>
> > Hi Julian,
> > I apologize for the same.
> >
> > It was not my intention to do so. I very much wanted to acknowledge the
> > replies, however, I could not do so as mentioned on my 2nd post:
> > https://lists.apache.org/thread/27v6pymkm8qfxfkrf2pojl8w1bpmjwzc (I
> asked
> > for instructions on replying back to the mailing list on this as well).
> >
> > Failing to get a reply for that, I had to send emails to the mailing list
> > again (I tried subscribing but the system is demanding some kind of SSO
> > login).
> >
> > Could you please tell me how to subscribe? I will then reply to the
> > particular queries I had on each post.
> >
> > Thanks & Regards,
> > Pranav
> >
> >
> >
> >
> >
> > On Fri, Aug 5, 2022, 2:06 PM Julian Hyde  wrote:
> >
> > > Pranav,
> > >
> > > Please subscribe to this list. You have asked several questions,
> received
> > > replies, not acknowledged those replies, and asked further questions.
> > Also,
> > > since you are not subscribed, each email you post has to go through
> > manual
> > > moderation.
> > >
> > > Julian
> > >
> > > > On Aug 5, 2022, at 9:38 AM, Pranav Deshpande <
> > > deshpande.v.pra...@gmail.com> wrote:
> > > >
> > > > Dear Apache Calcite Team,
> > > > I have 2 questions.
> > > >
> > > > -
> > > > 1.
> > > >
> > > > There are plenty of examples on how to push down projects and filters
> > > into
> > > > the leaf nodes (tablescans).
> > > >
> > > > However, I could not find any examples to push down joins to
> TableScans
> > > (or
> > > > joins+filters+projects etc.) [this is helpful for data federation I
> > > think].
> > > >
> > > > On the mailing list, many folks are suggesting that I use Drill.
> > However,
> > > > the purpose of my exercise is to gain knowledge about DBMS and Query
> > > > processing etc.
> > > >
> > > > I tried debugging open source engines that use Calcite (Drill, Druid,
> > > Trino
> > > > etc.) but was completely lost.
> > > >
> > > > Any examples/pointers/guidance around the same would be appreciated.
> > > > Example, pushing down a join with a filter to a DBMS(consider jdbc
> > > > msql etc.)
> > > >
> > > > -
> > > > 2.
> > > >
> > > > The 2nd question I have is regarding conventions and different DBMS.
> > The
> > > > cluster has a method to replace the trait convention(Bindable,JDBC
> > etc.),
> > > > and then we optimize and get the physical plan.
> > > >
> > > > But imagine I have both the MYSQL JDBC convnction and a cassandra
> > > > convention and some user is trying to query both tables.
> > > >
> > > > Something like "SELECT users.username, specialdata.country from
> > > > cassandraDB.user join mysqlDB.specialdata ON users.id
> > > =specialdata.userid"
> > > >
> > > > Now, how will calcite do the optimization here? The planner is not
> > > > accepting 2 different conventions.
> > > >
> > > > Thanks & Regards,
> > > > Pranav
> > >
> > >
> >
>


Re: Problem with char type after upgrading from 1.30.0 to 1.31.0

2022-08-12 Thread Julian Hyde
I don’t know whether we ever officially supported the Java ‘char’ type. It’s 
worth checking whether there are any tests for it.

More generally: if your organization is using Calcite in an unconventional way, 
consider writing some tests for that area of functionality and contributing 
them. You will be helping yourself and Calcite.

Julian


> On Aug 12, 2022, at 7:06 AM, Ruben Q L  wrote:
> 
> Hello Dmitry,
> 
> At first glance, it looks like a regression. Could you please create a Jira
> ticket (ideally with a unit test that runs fine 1.30 but fails in 1.31)?
> 
> Best,
> Ruben
> 
> 
> On Fri, Aug 12, 2022 at 2:48 PM Dmitry Sysolyatin 
> wrote:
> 
>> Hi!
>> I have a problem with char data type after upgrading from 1.30 to 1.31. I
>> tried to execute a simple query "SELECT c.relkind FROM pg_catalog.pg_class
>> c" (relkind is JavaType(char) NOT NULL) and got an exception:
>> 
>> Unable to implement EnumerableCalc(expr#0..32=[{inputs}], relkind=[$t16]):
>> rowcount = 100.0, cumulative cost = {200.0 rows, 3501.0 cpu, 0.0 io}, id =
>> 28
>>  EnumerableTableScan(table=[[default, pg_catalog, pg_class]]): rowcount =
>> 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 19
>> 
>> Suppressed: java.lang.RuntimeException: while resolving method
>> 'toChar[class java.lang.Object]' in class class
>> org.apache.calcite.runtime.SqlFunctions
>> at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:318)
>> at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:448)
>> at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:460)
>> 
>> Queries with char literal work OK: "SELECT 'r';"
>> Does someone have an idea what can be wrong ?
>> 



Re: Problem with char type after upgrading from 1.30.0 to 1.31.0

2022-08-12 Thread Ruben Q L
Hello Dmitry,

At first glance, it looks like a regression. Could you please create a Jira
ticket (ideally with a unit test that runs fine 1.30 but fails in 1.31)?

Best,
Ruben


On Fri, Aug 12, 2022 at 2:48 PM Dmitry Sysolyatin 
wrote:

> Hi!
> I have a problem with char data type after upgrading from 1.30 to 1.31. I
> tried to execute a simple query "SELECT c.relkind FROM pg_catalog.pg_class
> c" (relkind is JavaType(char) NOT NULL) and got an exception:
>
> Unable to implement EnumerableCalc(expr#0..32=[{inputs}], relkind=[$t16]):
> rowcount = 100.0, cumulative cost = {200.0 rows, 3501.0 cpu, 0.0 io}, id =
> 28
>   EnumerableTableScan(table=[[default, pg_catalog, pg_class]]): rowcount =
> 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 19
>
> Suppressed: java.lang.RuntimeException: while resolving method
> 'toChar[class java.lang.Object]' in class class
> org.apache.calcite.runtime.SqlFunctions
> at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:318)
> at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:448)
> at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:460)
>
> Queries with char literal work OK: "SELECT 'r';"
> Does someone have an idea what can be wrong ?
>


Problem with char type after upgrading from 1.30.0 to 1.31.0

2022-08-12 Thread Dmitry Sysolyatin
Hi!
I have a problem with char data type after upgrading from 1.30 to 1.31. I
tried to execute a simple query "SELECT c.relkind FROM pg_catalog.pg_class
c" (relkind is JavaType(char) NOT NULL) and got an exception:

Unable to implement EnumerableCalc(expr#0..32=[{inputs}], relkind=[$t16]):
rowcount = 100.0, cumulative cost = {200.0 rows, 3501.0 cpu, 0.0 io}, id =
28
  EnumerableTableScan(table=[[default, pg_catalog, pg_class]]): rowcount =
100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 19

Suppressed: java.lang.RuntimeException: while resolving method
'toChar[class java.lang.Object]' in class class
org.apache.calcite.runtime.SqlFunctions
at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:318)
at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:448)
at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:460)

Queries with char literal work OK: "SELECT 'r';"
Does someone have an idea what can be wrong ?