You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Csaba Ringhofer (Jira)" <ji...@apache.org> on 2025/02/27 13:57:00 UTC

[jira] [Created] (IMPALA-13806) Avoid per-function std::locale creation

Csaba Ringhofer created IMPALA-13806:
----------------------------------------

             Summary: Avoid per-function std::locale creation
                 Key: IMPALA-13806
                 URL: https://issues.apache.org/jira/browse/IMPALA-13806
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
            Reporter: Csaba Ringhofer


https://github.com/apache/impala/blob/4c549d79f2648c5ed906deef42c8d05bb747d8b0/be/src/exprs/mask-functions-ir.cc#L151

The line above creates a local on every invocation of the mask function.
This has 2 issues:
1. probably makes the function slower
2. it may turn out during execution that the locale cannot be created, leading to an exception (and crash at the moment)

std::locale/facet is thread safe (and immutable) based on https://en.cppreference.com/w/cpp/locale/locale

A locale could be created per fragment instance or a global "en_US.UTF-8" could be used at all places.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)