<?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: Issue with handle kafka data into hive table in hdfs in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Issue-with-handle-kafka-data-into-hive-table-in-hdfs/m-p/83375#M84818</link>
    <description>&lt;P&gt;The Problem was solved because of the thread unsafe SimpleDateFormat method，replaced the method with&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;&lt;SPAN&gt;fdf &lt;/SPAN&gt;= FastDateFormat.&lt;SPAN&gt;getInstance&lt;/SPAN&gt;(&lt;SPAN&gt;"yyyy_MM"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;tz&lt;/SPAN&gt;)&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;checked the data is fine now .&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 09:23:06 GMT</pubDate>
    <dc:creator>Striver</dc:creator>
    <dc:date>2018-12-06T09:23:06Z</dc:date>
    <item>
      <title>Issue with handle kafka data into hive table in hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Issue-with-handle-kafka-data-into-hive-table-in-hdfs/m-p/82232#M84817</link>
      <description>&lt;P&gt;I just used streaming to handle kafka data, and write it into hive table in hdfs.The hive table was partitioned by month/day which the time in the kafka data and I&amp;nbsp;compute the month/day with it as below:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;&lt;SPAN&gt;sdf&lt;/SPAN&gt;=&lt;SPAN&gt;new &lt;/SPAN&gt;SimpleDateFormat(&lt;SPAN&gt;"yyyy_MM"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;&lt;SPAN&gt;sdf1&lt;/SPAN&gt;=&lt;SPAN&gt;new &lt;/SPAN&gt;SimpleDateFormat(&lt;SPAN&gt;"dd"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;adjustTime = data.getLong(&lt;SPAN&gt;12&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;month = &lt;SPAN&gt;sdf&lt;/SPAN&gt;.format(&lt;SPAN&gt;new &lt;/SPAN&gt;Date(adjustTime))&lt;BR /&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;day = &lt;SPAN&gt;sdf1&lt;/SPAN&gt;.format(&lt;SPAN&gt;new &lt;/SPAN&gt;Date(adjustTime))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and I used repartition when I parse the data&lt;/P&gt;&lt;PRE&gt;repartition(&lt;SPAN&gt;$"month"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;$"day"&lt;/SPAN&gt;).write.mode(SaveMode.&lt;SPAN&gt;Append&lt;/SPAN&gt;).partitionBy(&lt;SPAN&gt;"month"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"day"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;when I checked the data in hdfs I found the problems:&lt;/P&gt;&lt;P&gt;1.The partitioned day appeared like month="2018_09" day ="31",the problem is that Sep could not have 31th.&lt;/P&gt;&lt;P&gt;2.in the someday partition, the data is not belog to this day, just like the adjusttime is 2018-09-30,but the data in partition 2018_09_30 have more data with other time like 2018_03_08 and ... The data in it is not correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I will be appreciated for it if any suggestions or ideas to solve these problems. Thanks~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:53:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Issue-with-handle-kafka-data-into-hive-table-in-hdfs/m-p/82232#M84817</guid>
      <dc:creator>Striver</dc:creator>
      <dc:date>2022-09-16T13:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with handle kafka data into hive table in hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Issue-with-handle-kafka-data-into-hive-table-in-hdfs/m-p/83375#M84818</link>
      <description>&lt;P&gt;The Problem was solved because of the thread unsafe SimpleDateFormat method，replaced the method with&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;&lt;SPAN&gt;fdf &lt;/SPAN&gt;= FastDateFormat.&lt;SPAN&gt;getInstance&lt;/SPAN&gt;(&lt;SPAN&gt;"yyyy_MM"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;tz&lt;/SPAN&gt;)&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;checked the data is fine now .&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 09:23:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Issue-with-handle-kafka-data-into-hive-table-in-hdfs/m-p/83375#M84818</guid>
      <dc:creator>Striver</dc:creator>
      <dc:date>2018-12-06T09:23:06Z</dc:date>
    </item>
  </channel>
</rss>

