Xinyao Zhang created SPARK-61933:
------------------------------------

             Summary: Four-argument instr returns 1 for an empty substring when 
start is zero
                 Key: SPARK-61933
                 URL: https://issues.apache.org/jira/browse/SPARK-61933
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 5.0.0
            Reporter: Xinyao Zhang


{{SELECT instr('abc', '', 0, 1);}} returns {{1}}. The documented result for a 
zero start position is {{0}}. The occurrence overload handles the empty pattern 
first and returns before checking the start position.

[PR #59346|https://github.com/apache/spark/pull/59346] adds regression coverage 
for the four-argument overload across binary, lowercase, and ICU collations. 
[SPARK-48284|https://issues.apache.org/jira/browse/SPARK-48284] covers broader 
empty-string search behavior in the underlying UTF8String API.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to