calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: Lossless cast
Date Mon, 24 Apr 2017 19:46:28 GMT
RexUtil.gatherConstraint deals with “widening” casts, which are similar. (Every widening
cast is lossless, but not every lossless cast is widening.)

But I don’t see an actual method, with unit tests, that tests for lossless casts. (The obvious
places to look would be RexUtil and RexProgramTest.) Feel free to add one. It would be useful.

Julian



> On Apr 24, 2017, at 12:32 PM, Jesus Camacho Rodriguez <jcamacho@apache.org> wrote:
> 
> Hi all,
> 
> Are you aware of any utility methods in Calcite core to identify 'lossless' casts, i.e.,
casts from which the original value of the field can be certainly recovered?
> 
> For instance, int -> bigint is true (as you can cast back to int without loss of information),
however bigint -> int is false.
> 
> Thanks,
> Jesús
> 
> 


Mime
View raw message