<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How can I remove accents from a string in Impala? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-remove-accents-from-a-string-in-Impala/m-p/79202#M13119</link>
    <description>&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume I have the following string: "Gánémílózú"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the query to return "Ganemilozu" (without the accents)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to use the &lt;A href="https://www.cloudera.com/documentation/enterprise/5-14-x/topics/impala_string_functions.html" target="_blank"&gt;translate&lt;/A&gt; function, as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECT translate('Gánémílózú', 'áéíóú', 'aeiou') FROM (SELECT 1) as dual;&lt;/PRE&gt;&lt;P&gt;But it returns "&lt;SPAN&gt;Gaenaomalaza". Apparently I didn't understand the translate function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone explain&amp;nbsp;&lt;STRONG&gt;why doesn't my approach work&lt;/STRONG&gt; or&amp;nbsp;&lt;STRONG&gt;lead me to a possible solution to remove the accents&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that the problem lies not in the translate function but in the handling of accents by Impala.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The translation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECT translate('Gánémílózú', 'Gnmlz', '12345') FROM (SELECT 1) as dual;&lt;/PRE&gt;&lt;P&gt;Works perfectly fine by returning&amp;nbsp;&lt;SPAN&gt;1á2é3í4ó5ú&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone know how does Impala handle characters with accents?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:38:59 GMT</pubDate>
    <dc:creator>jgutierrezh</dc:creator>
    <dc:date>2022-09-16T13:38:59Z</dc:date>
  </channel>
</rss>

