You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2016/08/04 17:33:20 UTC

[jira] [Resolved] (SPARK-16890) substring returns wrong result for positive position

     [ https://issues.apache.org/jira/browse/SPARK-16890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen resolved SPARK-16890.
-------------------------------
    Resolution: Not A Problem

Yes, this is how it's supposed to work. Compare with https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF

> substring returns wrong result for positive position
> ----------------------------------------------------
>
>                 Key: SPARK-16890
>                 URL: https://issues.apache.org/jira/browse/SPARK-16890
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.2, 1.6.2, 2.0.0
>            Reporter: Kapil Singh
>
> If position > 0 then substring function reduces it by 1. So if it is invoked like substring("First", 1, 4) then result is "Fir" instead of "irs". This is because UTF8String's substring method does this fancy modification before invoking substring on underlying String.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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