<?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 Alter column type in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117316#M17024</link>
    <description>&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;Effectively, if the data was stored already with timetamp type and the we change the type, the select will not work and we will have the ClassCastException.&lt;/P&gt;&lt;P&gt;If no data was alreday stored with the timestamp type (all values are null) and then we change the type , the select works fine.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2016 21:39:10 GMT</pubDate>
    <dc:creator>ahmed_missaoui_</dc:creator>
    <dc:date>2016-01-29T21:39:10Z</dc:date>
    <item>
      <title>Hive Alter column type</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117314#M17022</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;I am using hive 1.2.1.&lt;/P&gt;&lt;P&gt;I executed the following command to change the type of a column from timestamp to date&lt;/P&gt;&lt;P&gt;ALTER TABLE table_name CHANGE column_name column_name date CASCADE;&lt;/P&gt;&lt;P&gt;the command was executed successfully.&lt;/P&gt;&lt;P&gt;when i want to retrieve the data from the table using: select * from table_name&lt;/P&gt;&lt;P&gt;I got the following error:&lt;/P&gt;&lt;P&gt;Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.io.TimestampWritable cannot be cast to org.apache.hadoop.hive.serde2.io.DateWritable&lt;/P&gt;&lt;P&gt;thanks for help.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 21:18:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117314#M17022</guid>
      <dc:creator>ahmed_missaoui_</dc:creator>
      <dc:date>2016-01-29T21:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Alter column type</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117315#M17023</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/1853/ahmedmissaoui88.html" nodeid="1853"&gt;@Ahmed Missaoui&lt;/A&gt;&lt;P&gt; It has to do with the dataset in the table. Check if date has proper fields.&lt;/P&gt;&lt;P&gt;Good &lt;A target="_blank" href="http://stackoverflow.com/questions/29697493/unable-to-query-date-field-in-hive-external-table"&gt;reference&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 21:22:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117315#M17023</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-01-29T21:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Hive Alter column type</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117316#M17024</link>
      <description>&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;Effectively, if the data was stored already with timetamp type and the we change the type, the select will not work and we will have the ClassCastException.&lt;/P&gt;&lt;P&gt;If no data was alreday stored with the timestamp type (all values are null) and then we change the type , the select works fine.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 21:39:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-Alter-column-type/m-p/117316#M17024</guid>
      <dc:creator>ahmed_missaoui_</dc:creator>
      <dc:date>2016-01-29T21:39:10Z</dc:date>
    </item>
  </channel>
</rss>

