<?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 hive create table having timestamp with timezone data type in Athena in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/hive-create-table-having-timestamp-with-timezone-data-type/m-p/280632#M208934</link>
    <description>&lt;P&gt;I tried to find solution that fits my use case and tried many things, but failed.&lt;/P&gt;
&lt;P&gt;Please help me. Thank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have input in following format:&lt;/P&gt;
&lt;P&gt;12,&amp;nbsp;2019-07-08 00:02:54.436062+00&lt;/P&gt;
&lt;P&gt;23, 2019-07-08 00:48:41.23138+00&lt;/P&gt;
&lt;P&gt;..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how do i create table with timestamp datatype for 2nd column. Please don't suggest regexSerDe. (because this is dummy example, my test string is very complex)&lt;/P&gt;
&lt;P&gt;In all my input data, all values in 2nd col have '+00' in the end. So, I don't even have to convert to any timezone, i can just skip last 3 characters when parsing. Is there any way to do that?&lt;/P&gt;
&lt;P&gt;What I have tried&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CREATE EXTERNAL TABLE test (&lt;/P&gt;
&lt;P&gt;&amp;nbsp; id int,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ts timestamp)&lt;/P&gt;
&lt;P&gt;ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'&lt;BR /&gt;WITH SERDEPROPERTIES (&lt;BR /&gt;'serialization.format' = ',',&lt;BR /&gt;'field.delim' = ','&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;LOCATION 's3://user/'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 16:32:39 GMT</pubDate>
    <dc:creator>prakharjain</dc:creator>
    <dc:date>2019-10-18T16:32:39Z</dc:date>
    <item>
      <title>hive create table having timestamp with timezone data type in Athena</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-create-table-having-timestamp-with-timezone-data-type/m-p/280632#M208934</link>
      <description>&lt;P&gt;I tried to find solution that fits my use case and tried many things, but failed.&lt;/P&gt;
&lt;P&gt;Please help me. Thank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have input in following format:&lt;/P&gt;
&lt;P&gt;12,&amp;nbsp;2019-07-08 00:02:54.436062+00&lt;/P&gt;
&lt;P&gt;23, 2019-07-08 00:48:41.23138+00&lt;/P&gt;
&lt;P&gt;..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how do i create table with timestamp datatype for 2nd column. Please don't suggest regexSerDe. (because this is dummy example, my test string is very complex)&lt;/P&gt;
&lt;P&gt;In all my input data, all values in 2nd col have '+00' in the end. So, I don't even have to convert to any timezone, i can just skip last 3 characters when parsing. Is there any way to do that?&lt;/P&gt;
&lt;P&gt;What I have tried&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CREATE EXTERNAL TABLE test (&lt;/P&gt;
&lt;P&gt;&amp;nbsp; id int,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ts timestamp)&lt;/P&gt;
&lt;P&gt;ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'&lt;BR /&gt;WITH SERDEPROPERTIES (&lt;BR /&gt;'serialization.format' = ',',&lt;BR /&gt;'field.delim' = ','&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;LOCATION 's3://user/'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 16:32:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-create-table-having-timestamp-with-timezone-data-type/m-p/280632#M208934</guid>
      <dc:creator>prakharjain</dc:creator>
      <dc:date>2019-10-18T16:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: hive create table having timestamp with timezone data type in Athena</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-create-table-having-timestamp-with-timezone-data-type/m-p/280669#M208942</link>
      <description>&lt;P&gt;Solved it using,&lt;/P&gt;&lt;P&gt;CREATE EXTERNAL TABLE test (&lt;/P&gt;&lt;P&gt;&amp;nbsp; id int,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ts timestamp)&lt;/P&gt;&lt;P&gt;ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'&lt;BR /&gt;WITH SERDEPROPERTIES (&lt;BR /&gt;'serialization.format' = ',',&lt;BR /&gt;'field.delim' = ',',&lt;/P&gt;&lt;P&gt;"timestamp.formats"="yyyy-MM-dd HH:mm:ss.SSSSSS+00"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;LOCATION 's3://user/'&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 16:44:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-create-table-having-timestamp-with-timezone-data-type/m-p/280669#M208942</guid>
      <dc:creator>prakharjain</dc:creator>
      <dc:date>2019-10-18T16:44:48Z</dc:date>
    </item>
  </channel>
</rss>

