Skip to content

Fix GET_FORMAT UDF#3543

Merged
qianheng-aws merged 1 commit into
opensearch-project:mainfrom
yuancu:fix-get-format
Apr 14, 2025
Merged

Fix GET_FORMAT UDF#3543
qianheng-aws merged 1 commit into
opensearch-project:mainfrom
yuancu:fix-get-format

Conversation

@yuancu
Copy link
Copy Markdown
Collaborator

@yuancu yuancu commented Apr 14, 2025

Problem Description

When locale is set using -Dtests.locale=az-Cyrl, GET_FORMAT(TIME, [whatever]) and GET_FORMAT(TIMESTAMP, [whatever]) will always return NULL.

Root Cause

At DateTimeFunctions.java:L1511, when the local is set to Turkic languages (e.g. Turkish, Azerbaijani), type.stringValue().toLowerCase will return tıme for TIME, where ı is a dotless i, causing the key not existing in the predefined formats map.

Fix

Specify locale as Locale.ROOT when converting this string to lowercase.

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

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>
@qianheng-aws qianheng-aws merged commit d0a6b47 into opensearch-project:main Apr 14, 2025
22 checks passed
penghuo pushed a commit that referenced this pull request Jun 16, 2025
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>
Signed-off-by: xinyual <xinyual@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants