[
https://issues.apache.org/jira/browse/CALCITE-7398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18054534#comment-18054534
]
Alessandro Solimando commented on CALCITE-7398:
-----------------------------------------------
Suppose you are still on 1.38.0, and you encounter this issue, seeing 1.41.0
might make you think that it's a different issue, with the same symptoms, and
you wouldn't be confident that upgrading to 1.42.0, you would fix your problem.
With affected versions 1.38.0 and fix version 1.42.0, it's pretty clear that
[1.38.0, 1.42.0) is affected.
If you really want, you can add 1.41.0 to the affected versions (it can have
many), but by replacing 1.38.0 with 1.41.0, we lose information, so let's keep
1.38.0
> Incorrect int cast in VariantNonNull#cast for BIGINT
> ----------------------------------------------------
>
> Key: CALCITE-7398
> URL: https://issues.apache.org/jira/browse/CALCITE-7398
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.41.0
> Reporter: heng qian
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> In `VariantNonNull.java`, the `cast()` method has a bug in the `BIGINT` case
> at line 289:
> {code:java}
> case BIGINT: {
> long l = (int) value; // Bug: should be (long) value
> ...
> } {code}
> The value field for BIGINT type is stored as Long (verified by the
> constructor's assertion assert value instanceof Long). However, the code
> incorrectly casts it to int before assigning to the long variable.
> This causes a variant value with BIGINT runtime type to be null, since the
> cast function throws exception in this place.
> {code:java}
> java.lang.ClassCastException: class java.lang.Long cannot be cast to class
> java.lang.Integer (java.lang.Long and java.lang.Integer are in module
> java.base of loader 'bootstrap'){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)