You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-49775][SQL][TESTS] Make tests of INVALID_PARAMETER_VALUE.CHARSET deterministic
### What changes were proposed in this pull request?
Make tests of `INVALID_PARAMETER_VALUE.CHARSET` deterministic
### Why are the changes needed?
`VALID_CHARSETS` is a Set, so `VALID_CHARSETS.mkString(", ")` is non-deterministic, and cause failures in different testing environments, e.g.
```
org.scalatest.exceptions.TestFailedException: ansi/string-functions.sql
Expected "...sets" : "UTF-16LE, U[TF-8, UTF-32, UTF-16BE, UTF-16, US-ASCII, ISO-8859-1]",
"functionName...", but got "...sets" : "UTF-16LE, U[S-ASCII, ISO-8859-1, UTF-8, UTF-32, UTF-16BE, UTF-16]",
"functionName..." Result did not match for query apache#93
select encode('hello', 'WINDOWS-1252')
at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:472)
at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:471)
at org.scalatest.funsuite.AnyFunSuite.newAssertionFailedException(AnyFunSuite.scala:1564)
at org.scalatest.Assertions.assertResult(Assertions.scala:847)
at org.scalatest.Assertions.assertResult$(Assertions.scala:842)
at org.scalatest.funsuite.AnyFunSuite.assertResult(AnyFunSuite.scala:1564)
```
### Does this PR introduce _any_ user-facing change?
No, test only
### How was this patch tested?
updated tests
### Was this patch authored or co-authored using generative AI tooling?
no
Closesapache#48235 from zhengruifeng/sql_test_sort_charset.
Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
0 commit comments