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

Sean R. Owen updated SPARK-37013:
---------------------------------
    Docs Text: Since Spark 3.3, the `strfmt` in `format_string(strfmt, obj, 
...)` and `printf(strfmt, obj, ...)` will no longer support to use "0$" to 
specify the first argument, the first argument should always reference by "1$" 
when use argument index to indicating the position of the argument in the 
argument list.

> `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
>            Priority: Major
>
> {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 17
> {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