You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yuanjian Li (Jira)" <ji...@apache.org> on 2020/06/28 04:29:00 UTC

[jira] [Created] (SPARK-32115) Incorrect results for SUBSTRING when overflow

Yuanjian Li created SPARK-32115:
-----------------------------------

             Summary: Incorrect results for SUBSTRING when overflow
                 Key: SPARK-32115
                 URL: https://issues.apache.org/jira/browse/SPARK-32115
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Yuanjian Li


SQL query SELECT SUBSTRING("abc", -1207959552, -1207959552) in Spark incorrectly returns "abc" against expected output of "".
This is a result of integer overflow in addition [https://github.com/apache/spark/blob/8c44d744631516a5cdaf63406e69a9dd11e5b878/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L345]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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