snuyanzin commented on code in PR #3113:
URL: https://github.com/apache/calcite/pull/3113#discussion_r1195045461
##########
core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java:
##########
@@ -738,17 +741,7 @@ public static ParsedCollation parseCollation(String in) {
}
Charset charset = SqlUtil.getCharset(charsetStr);
- String[] localeParts = localeStr.split("_");
- Locale locale;
- if (1 == localeParts.length) {
- locale = new Locale(localeParts[0]);
- } else if (2 == localeParts.length) {
- locale = new Locale(localeParts[0], localeParts[1]);
- } else if (3 == localeParts.length) {
- locale = new Locale(localeParts[0], localeParts[1], localeParts[2]);
- } else {
- throw RESOURCE.illegalLocaleFormat(localeStr).ex();
Review Comment:
Since this change makes use of IETF BCP 47 language tag string (used by
Locale#forLanguageTag) there could be more parts. Fallback is jdk's fallback
Added info to `history.md`
Thanks about mentioning `RESOURCE.illegalLocaleFormat`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]