<?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 unhex in Impala in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42163#M32439</link>
    <description>&lt;P&gt;Running in Impala I try the following&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;select unhex('4B')&lt;/PRE&gt;&lt;P&gt;and I get a string result of &lt;FONT color="#FF0000"&gt;K&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I go to&amp;nbsp;&lt;A title="Hex to decimal converter" href="http://www.binaryhexconverter.com/hex-to-decimal-converter" target="_blank"&gt;Hex to decimal converter&lt;/A&gt;&amp;nbsp;to convert hex value '4B' I get the number 75 which is what I expect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is unhex not a hexadecimal to decimal converter?&lt;/P&gt;&lt;P&gt;according to&amp;nbsp;&lt;A href="http://www.cloudera.com/documentation/enterprise/5-5-x/topics/impala_math_functions.html" target="_self"&gt;http://www.cloudera.com/documentation/enterprise/5-5-x/topics/impala_math_functions.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;unhex(string a)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Purpose:&lt;/STRONG&gt; Returns a string of characters with ASCII values corresponding to pairs of hexadecimal digits in the argument.&lt;/P&gt;&lt;P class="p"&gt;&lt;STRONG&gt;Return type:&lt;/STRONG&gt; string&lt;/P&gt;&lt;P class="p"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p"&gt;&lt;SPAN&gt;I&amp;nbsp;don't even know where to begin to start troubleshooting this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 10:26:22 GMT</pubDate>
    <dc:creator>scratch28</dc:creator>
    <dc:date>2022-09-16T10:26:22Z</dc:date>
    <item>
      <title>unhex in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42163#M32439</link>
      <description>&lt;P&gt;Running in Impala I try the following&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;select unhex('4B')&lt;/PRE&gt;&lt;P&gt;and I get a string result of &lt;FONT color="#FF0000"&gt;K&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I go to&amp;nbsp;&lt;A title="Hex to decimal converter" href="http://www.binaryhexconverter.com/hex-to-decimal-converter" target="_blank"&gt;Hex to decimal converter&lt;/A&gt;&amp;nbsp;to convert hex value '4B' I get the number 75 which is what I expect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is unhex not a hexadecimal to decimal converter?&lt;/P&gt;&lt;P&gt;according to&amp;nbsp;&lt;A href="http://www.cloudera.com/documentation/enterprise/5-5-x/topics/impala_math_functions.html" target="_self"&gt;http://www.cloudera.com/documentation/enterprise/5-5-x/topics/impala_math_functions.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;unhex(string a)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Purpose:&lt;/STRONG&gt; Returns a string of characters with ASCII values corresponding to pairs of hexadecimal digits in the argument.&lt;/P&gt;&lt;P class="p"&gt;&lt;STRONG&gt;Return type:&lt;/STRONG&gt; string&lt;/P&gt;&lt;P class="p"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p"&gt;&lt;SPAN&gt;I&amp;nbsp;don't even know where to begin to start troubleshooting this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:26:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42163#M32439</guid>
      <dc:creator>scratch28</dc:creator>
      <dc:date>2022-09-16T10:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: unhex in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42164#M32440</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Impala implemented this function for Hive compatibility. The behavior is the same is in Hive. I'm not sure why Hive decided to implement the function this way. The input "4B" is converted to a character using the same logic as shown in &lt;A href="http://www.asciitable.com/," target="_blank"&gt;http://www.asciitable.com/,&lt;/A&gt; you'll see "4B" corresponds to the character "K" (column "Hx" to column "Chr"). In the "4B" case,&amp;nbsp;the ASCII() function can be used to give the value you expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Query: select ascii(unhex('4b'))
+--------------------+
| ascii(unhex('4b')) |
+--------------------+
| 75                 |
+--------------------+&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 21:52:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42164#M32440</guid>
      <dc:creator>casey</dc:creator>
      <dc:date>2016-06-20T21:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: unhex in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42192#M32441</link>
      <description>&lt;P&gt;Thanks very helpful&lt;/P&gt;&lt;P&gt;but the ASCII function only translates the first character&lt;/P&gt;&lt;P&gt;and the decode function (in hive) is in conflict with Impala interpretation of decode UDF to be similar to case (a poor decision IMHO since case is much more readable than decode) &amp;nbsp; Anyway opinions aside&lt;/P&gt;&lt;P&gt;How do I convert a large hex value into a large number?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  
   select ascii(unhex('130F9C6D6A2972')) largenumber
   , ascii(unhex('13')) firstpart &lt;/PRE&gt;&lt;P&gt;both yeild the value of &lt;FONT color="#FF0000"&gt;19&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;when the first one suppose to yeild&amp;nbsp;&lt;FONT color="#FF0000"&gt;5365189082491250&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 17:21:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42192#M32441</guid>
      <dc:creator>scratch28</dc:creator>
      <dc:date>2016-06-21T17:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: unhex in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42199#M32442</link>
      <description>&lt;P&gt;Unfortunately there doesn't seem to be a function that does this. If you are familiar with Java or C++, writing a UDF shouldn't be too hard. UDF documentation is at&amp;nbsp;&lt;A href="http://www.cloudera.com/documentation/enterprise/latest/topics/impala_udf.html" target="_blank"&gt;http://www.cloudera.com/documentation/enterprise/latest/topics/impala_udf.html&lt;/A&gt; and of course if you have questions we can help you here.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 18:54:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/unhex-in-Impala/m-p/42199#M32442</guid>
      <dc:creator>casey</dc:creator>
      <dc:date>2016-06-21T18:54:45Z</dc:date>
    </item>
  </channel>
</rss>

