title: converting values from string to int in hive
body: <p>I am creating a table in hive;</p>
  
  <pre><code>create table patients(
    patient_id INT,
    age_group STRING,
    gender STRING,
    income_range STRING
  )
  ROW FORMAT DELIMITED FIELDS TERMINATED BY ' ';
  
  load data local inpath '/mnt/patients.csv' into table patients;
  </code></pre>
  
  <p>Now when I am using the command:</p>
  
  <pre><code>hive&gt;select * from patients limit 5;
  </code></pre>
  
  <p>I am getting the output:</p>
  
  <pre><code>NULL    75-84,  F,      32000-47999
  NULL    75-84,  M,      16000-23999
  NULL    85+,    M,      &lt;16000
  NULL    65-74,  F,      32000-47999
  NULL    &lt;65,    M,      &lt;16000
  </code></pre>
  
  <p>But when I am using assigning patient_id as string its showing:</p>
  
  <pre><code> 910997967,      75-84,  F,      32000-47999
   506013497,      75-84,  M,      16000-23999
   432041392,      85+,    M,      &lt;16000
   633048699,      65-74,  F,      32000-47999
  </code></pre>
  
  <p>I tried to use :</p>
  
  <pre><code> hive&gt;select CAST(patient_id AS int) from patients;
  </code></pre>
  
  <p>But its not changing the values to int and only showing </p>
  
  <pre><code>NULL
  NULL
  ...
  </code></pre>
  
  <p>How could the values of patient_id can be converted to int values?</p>
  
  <p>Thanks</p>