Skip to content

Commit d0a6b47

Browse files
authored
Fix GET_FORMAT UDF (#3543)
by adding Locale.ROOT when converting string to lowercase to avoid irregular casting of I when defaulting to Turkic languages Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent e23a61d commit d0a6b47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,10 +1510,12 @@ public static ExprValue exprFromUnixTimeFormat(ExprValue time, ExprValue format)
15101510
*/
15111511
public static ExprValue exprGetFormat(ExprValue type, ExprValue format) {
15121512
if (formats.contains(
1513-
type.stringValue().toLowerCase(), format.stringValue().toLowerCase(Locale.ROOT))) {
1513+
type.stringValue().toLowerCase(Locale.ROOT),
1514+
format.stringValue().toLowerCase(Locale.ROOT))) {
15141515
return new ExprStringValue(
15151516
formats.get(
1516-
type.stringValue().toLowerCase(), format.stringValue().toLowerCase(Locale.ROOT)));
1517+
type.stringValue().toLowerCase(Locale.ROOT),
1518+
format.stringValue().toLowerCase(Locale.ROOT)));
15171519
}
15181520

15191521
return ExprNullValue.of();

0 commit comments

Comments
 (0)