You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Mihai Budiu <mb...@gmail.com> on 2023/12/19 03:13:15 UTC
warnings in Calcite
Does calcite have any facilities for reporting warnings to users?
Thank you,
Mihai
Re: warnings in Calcite
Posted by Julian Hyde <jh...@gmail.com>.
I think you're saying that prepare can return warnings. I wasn’t aware of that; I was only aware of warnings from execution (e.g. divide by zero happened).
Can you describe what warnings facility you have in mind?
> On Dec 18, 2023, at 10:53 PM, Mihai Budiu <mb...@gmail.com> wrote:
>
> All these cases where at compile time an exception is thrown and caught could be warnings - e.g. Casts that will fail at runtime, division by 0, etc.
>
> Mihai
> ________________________________
> From: Julian Hyde <jh...@gmail.com>
> Sent: Monday, December 18, 2023 10:41:11 PM
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: Re: warnings in Calcite
>
> I don’t think so. One place to surface warnings would be via java.sql.Statement.getWarnings() but Avatica’s default implementation of that method returns null.
>
> What are some scenarios where you think Calcite should give a warning?
>
> Julian
>
>
>> On Dec 18, 2023, at 7:13 PM, Mihai Budiu <mb...@gmail.com> wrote:
>>
>> Does calcite have any facilities for reporting warnings to users?
>>
>> Thank you,
>> Mihai
>
Re: warnings in Calcite
Posted by Mihai Budiu <mb...@gmail.com>.
All these cases where at compile time an exception is thrown and caught could be warnings - e.g. Casts that will fail at runtime, division by 0, etc.
Mihai
________________________________
From: Julian Hyde <jh...@gmail.com>
Sent: Monday, December 18, 2023 10:41:11 PM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: warnings in Calcite
I don’t think so. One place to surface warnings would be via java.sql.Statement.getWarnings() but Avatica’s default implementation of that method returns null.
What are some scenarios where you think Calcite should give a warning?
Julian
> On Dec 18, 2023, at 7:13 PM, Mihai Budiu <mb...@gmail.com> wrote:
>
> Does calcite have any facilities for reporting warnings to users?
>
> Thank you,
> Mihai
Re: warnings in Calcite
Posted by Mihai Budiu <mb...@gmail.com>.
The simplification code in Calcite effectively evaluates expressions at compilation time. For example, RexSimplify calls RexExecutor in simplifyCast. If the simplified expression generates an exception, simplification is aborted and the expression is kept unchanged and evaluated at runtime. But at this point the compiler knows that the expression will generate a runtime error, so it could give a warning.
(There's the additional complication of unspecified evaluation order, which could cause some such expressions never to be evaluated at runtime at all, but let's ignore this in the discussion.)
Mihai
________________________________
From: Julian Hyde <jh...@gmail.com>
Sent: Monday, December 18, 2023 10:41 PM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: warnings in Calcite
I don’t think so. One place to surface warnings would be via java.sql.Statement.getWarnings() but Avatica’s default implementation of that method returns null.
What are some scenarios where you think Calcite should give a warning?
Julian
> On Dec 18, 2023, at 7:13 PM, Mihai Budiu <mb...@gmail.com> wrote:
>
> Does calcite have any facilities for reporting warnings to users?
>
> Thank you,
> Mihai
Re: warnings in Calcite
Posted by Julian Hyde <jh...@gmail.com>.
I don’t think so. One place to surface warnings would be via java.sql.Statement.getWarnings() but Avatica’s default implementation of that method returns null.
What are some scenarios where you think Calcite should give a warning?
Julian
> On Dec 18, 2023, at 7:13 PM, Mihai Budiu <mb...@gmail.com> wrote:
>
> Does calcite have any facilities for reporting warnings to users?
>
> Thank you,
> Mihai