You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Anton Okolnychyi (JIRA)" <ji...@apache.org> on 2019/01/23 13:49:00 UTC

[jira] [Commented] (SPARK-26706) Fix Cast$mayTruncate for bytes

    [ https://issues.apache.org/jira/browse/SPARK-26706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16750002#comment-16750002 ] 

Anton Okolnychyi commented on SPARK-26706:
------------------------------------------

I am about to submit a fix.

> Fix Cast$mayTruncate for bytes
> ------------------------------
>
>                 Key: SPARK-26706
>                 URL: https://issues.apache.org/jira/browse/SPARK-26706
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.3.3, 3.0.0
>            Reporter: Anton Okolnychyi
>            Priority: Major
>
> The logic in {{Cast$mayTruncate}} is broken for bytes.
> Right now, {{mayTruncate(ByteType, LongType)}} returns {{false}} while {{mayTruncate(ShortType, LongType)}} returns {{true}}. Consequently, {{spark.range(1, 3).as[Byte]}} and {{spark.range(1, 3).as[Short]}} will behave differently.
> Potentially, this bug can silently corrupt someone's data.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org