<?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 Convert String to Int in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Convert-String-to-Int/m-p/334271#M231693</link>
    <description>&lt;P&gt;How to convert String Into Int in the SQL table&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jan 2022 10:14:15 GMT</pubDate>
    <dc:creator>KanteTelecom</dc:creator>
    <dc:date>2022-01-20T10:14:15Z</dc:date>
    <item>
      <title>Convert String to Int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Convert-String-to-Int/m-p/334271#M231693</link>
      <description>&lt;P&gt;How to convert String Into Int in the SQL table&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 10:14:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Convert-String-to-Int/m-p/334271#M231693</guid>
      <dc:creator>KanteTelecom</dc:creator>
      <dc:date>2022-01-20T10:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Convert-String-to-Int/m-p/334341#M231727</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;With the help of cast udf function, you can convert a string to an integer.&lt;BR /&gt;&lt;BR /&gt;cast(str_column as int)&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Reference -&amp;nbsp;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-TypeConversionFunctions" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-TypeConversionFunctions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the value is between –2147483648 and 2147483647, cast(string_filed as int) will work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;0: jdbc:hive2:Hive&amp;gt; select cast('2147483647' as int);
INFO  : Compiling command(queryId=hive_20220121054634_f3485a1b-692a-412d-8fe4-1c616c21d0aa): select cast('2147483647' as int)
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:int, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20220121054634_f3485a1b-692a-412d-8fe4-1c616c21d0aa); Time taken: 0.17 seconds
INFO  : Executing command(queryId=hive_20220121054634_f3485a1b-692a-412d-8fe4-1c616c21d0aa): select cast('2147483647' as int)
INFO  : Completed executing command(queryId=hive_20220121054634_f3485a1b-692a-412d-8fe4-1c616c21d0aa); Time taken: 0.009 seconds
INFO  : OK
+-------------+
|     _c0     |
+-------------+
| 2147483647  |
+-------------+
1 row selected (0.296 seconds)
0: jdbc:hive2://hive&amp;gt; select cast('2147483648' as int);
INFO  : Compiling command(queryId=hive_20220121054651_15cbd283-7de5-4310-bbe9-b262ebbd1e07): select cast('2147483648' as int)
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:int, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20220121054651_15cbd283-7de5-4310-bbe9-b262ebbd1e07); Time taken: 0.059 seconds
INFO  : Executing command(queryId=hive_20220121054651_15cbd283-7de5-4310-bbe9-b262ebbd1e07): select cast('2147483648' as int)
INFO  : Completed executing command(queryId=hive_20220121054651_15cbd283-7de5-4310-bbe9-b262ebbd1e07); Time taken: 0.006 seconds
INFO  : OK
+-------+
|  _c0  |
+-------+
| NULL  |
+-------+
1 row selected (0.086 seconds)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 05:57:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Convert-String-to-Int/m-p/334341#M231727</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2022-01-21T05:57:18Z</dc:date>
    </item>
  </channel>
</rss>

