Yang Jie created SPARK-37013:
--------------------------------

             Summary: `select format_string('%0$s', 'Hello')` has different 
behavior when using java 8 and Java 17
                 Key: SPARK-37013
                 URL: https://issues.apache.org/jira/browse/SPARK-37013
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.3.0
            Reporter: Yang Jie


{code:java}
--PostgreSQL throw ERROR:  format specifies argument 0, but arguments are 
numbered from 1
select format_string('%0$s', 'Hello');
{code}
Execute with Java 8
{code:java}
-- !query
select format_string('%0$s', 'Hello')
-- !query schema
struct<format_string(%0$s, Hello):string>
-- !query output
Hello
{code}
Execute with Java 11
{code:java}
-- !query
select format_string('%0$s', 'Hello')
-- !query schema
struct<>
-- !query output
java.util.IllegalFormatArgumentIndexException
Illegal format argument index = 0
{code}
 



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

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

Reply via email to