<?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 Re: Hive truncating char datatype when converting to string in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201744#M62540</link>
    <description>&lt;P&gt;Good to know this.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2017 17:31:02 GMT</pubDate>
    <dc:creator>SatishS</dc:creator>
    <dc:date>2017-06-09T17:31:02Z</dc:date>
    <item>
      <title>Hive truncating char datatype when converting to string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201741#M62537</link>
      <description>&lt;P&gt;I have noticed an issue in Hive 1.2 where char data is rtrimmed when converted to string.  This doesn't occur when converting varchar to string.  Is this a bug? or a feature?&lt;/P&gt;&lt;PRE&gt;select length(cast('abc    ' as char(10))), 
	   length(cast('abc    ' as varchar(10))),
	   length(cast('abc    ' as string));


_c0,_c1,_c2
3,7,7


&lt;/PRE&gt;&lt;P&gt;In the above example I would expect the length of the char field to be 10.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 02:18:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201741#M62537</guid>
      <dc:creator>bhopp</dc:creator>
      <dc:date>2017-06-08T02:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hive truncating char datatype when converting to string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201742#M62538</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/106703/hive-truncating-char-datatype-when-converting-to-s.html#"&gt;@Benjamin Hopp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Looks like it's a bug, because the Char always fixed length. In this case you have declared it as char(10), even though you have only 3 chars assigned it to, it should not truncate the rest.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 07:00:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201742#M62538</guid>
      <dc:creator>SatishS</dc:creator>
      <dc:date>2017-06-08T07:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hive truncating char datatype when converting to string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201743#M62539</link>
      <description>&lt;P&gt;It appears that this is expected behavior.  &lt;/P&gt;&lt;P&gt;I discovered a jira pertaining to it here: &lt;A href="https://issues.apache.org/jira/browse/HIVE-13865" target="_blank"&gt;https://issues.apache.org/jira/browse/HIVE-13865&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 20:36:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201743#M62539</guid>
      <dc:creator>bhopp</dc:creator>
      <dc:date>2017-06-08T20:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hive truncating char datatype when converting to string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201744#M62540</link>
      <description>&lt;P&gt;Good to know this.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 17:31:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-truncating-char-datatype-when-converting-to-string/m-p/201744#M62540</guid>
      <dc:creator>SatishS</dc:creator>
      <dc:date>2017-06-09T17:31:02Z</dc:date>
    </item>
  </channel>
</rss>

