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)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to