<?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: Timestamp Format Issue (NiFi's PutDatabaseRecord) in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/282985#M210327</link>
    <description>&lt;P&gt;It seems that the PutDatabaseRecord processor expects your timestamp to be numeric (probably milliseconds since the epoch).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I notice your screenshot contains a specification of the timestamp format, but I don't see this as an option in the documentation, so possibly that has no effect in this processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the reference:&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.2/org.apache.nifi.processors.standard.PutDatabaseRecord/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.2/org.apache.nifi.processors.standard.PutDatabaseRecord/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;Possible solution: Load or convert the timestamp to the right value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple trick to check what the value should be, is by manually inserting a date into the table, loading it with Nifi and then inspecting the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(You can also test writing it back, that should confirm that the value works).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2019 13:49:29 GMT</pubDate>
    <dc:creator>DennisJaheruddi</dc:creator>
    <dc:date>2019-11-14T13:49:29Z</dc:date>
    <item>
      <title>Timestamp Format Issue (NiFi's PutDatabaseRecord)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/282759#M210187</link>
      <description>&lt;P&gt;Getting error when inserting a csv-file into a MSSQL database using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PutDatabaseRecord (1.9.2) processor in Nifi&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;ListFile → FetchFile → PutDatabaseRecord&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 530px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/25277i371AA8AC49C4FB04/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/25278i7DB7793F27EC427E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 995px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/25279i69CB44DA1E200310/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The schema used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{ "type" : "record", "name" : "mibas_t005_talkgroup", "fields" : [  
{ "name" : "talkgroup_ref", "type" : ["null","long"] },
{ "name" : "fleet_ref", "type" : ["null","long"] },
{ "name" : "talkgroup_id", "type" : ["null","long"] },
{ "name" : "talkgroup_name", "type" : ["null","string"] },
{ "name" : "group_type", "type" : ["null","string"] },
{ "name" : "dispatcher_ref", "type" : ["null","string"] },
{ "name" : "multigroup_ref", "type" : ["null","string"] },
{ "name" : "owner_", "type" : ["null","string"] },
{ "name" : "fne_state", "type" : ["null","string"] },
{ "name" : "addl_attrvar", "type" : ["null","string"] },
{ "name" : "last_user_modified", "type" : ["null","string"] },
{ "name" : "time_stamp", "type" : ["null", { "type":"long", "logicaltype":"timestamp-millis"} ]},
{ "name" : "fne_oid", "type" : ["null","string"] }]}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Datatype in the table is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;DateTime&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 06:07:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/282759#M210187</guid>
      <dc:creator>lauritz</dc:creator>
      <dc:date>2019-11-13T06:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Format Issue (NiFi's PutDatabaseRecord)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/282985#M210327</link>
      <description>&lt;P&gt;It seems that the PutDatabaseRecord processor expects your timestamp to be numeric (probably milliseconds since the epoch).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I notice your screenshot contains a specification of the timestamp format, but I don't see this as an option in the documentation, so possibly that has no effect in this processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the reference:&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.2/org.apache.nifi.processors.standard.PutDatabaseRecord/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.2/org.apache.nifi.processors.standard.PutDatabaseRecord/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;Possible solution: Load or convert the timestamp to the right value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple trick to check what the value should be, is by manually inserting a date into the table, loading it with Nifi and then inspecting the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(You can also test writing it back, that should confirm that the value works).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:49:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/282985#M210327</guid>
      <dc:creator>DennisJaheruddi</dc:creator>
      <dc:date>2019-11-14T13:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Format Issue (NiFi's PutDatabaseRecord)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/283078#M210401</link>
      <description>&lt;P&gt;Thank you for your reply!&lt;BR /&gt;The timestamp format is an option in the CSVReader Controller Service, which is a valid service&lt;/P&gt;&lt;P&gt;record reader in the PutDatabaseRecord processor. The format used, is working fine in other workflows with the same setup.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 10:43:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/283078#M210401</guid>
      <dc:creator>lauritz</dc:creator>
      <dc:date>2019-11-15T10:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Format Issue (NiFi's PutDatabaseRecord)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/283089#M210412</link>
      <description>&lt;P&gt;I see, as there are several steps here it is a bit hard to pinpoint the problem. Please check what the timestamp looks like just before you write it to the database. If it still looks like a string, presumably something went wrong with the reading.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 13:00:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/283089#M210412</guid>
      <dc:creator>DennisJaheruddi</dc:creator>
      <dc:date>2019-11-15T13:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Format Issue (NiFi's PutDatabaseRecord)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/284766#M211422</link>
      <description>&lt;P&gt;The solution was changing the datatype definition in the schema from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;logicaltype&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;logicalType&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(Upper case T there for you). wtf!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg: *{ "name" : "time_stamp", "type" : ["null", { "type":"long", "&lt;STRONG&gt;&lt;EM&gt;logicalType&lt;/EM&gt;&lt;/STRONG&gt;":"timestamp-millis"}*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The irritating part is that the schema validates. No warning! But, if you mistakenly use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;String&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;instead of the correct&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;string&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(lower case S) or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Type&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;instead of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;type&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in you schema, your schema will not validate and you can correct it. But for&amp;nbsp;logicalType&lt;SPAN&gt;&amp;nbsp;no.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 13:45:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/284766#M211422</guid>
      <dc:creator>lauritz</dc:creator>
      <dc:date>2019-12-04T13:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Format Issue (NiFi's PutDatabaseRecord)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/284769#M211424</link>
      <description>&lt;P&gt;I understand this was hard to find.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One point that is not relevant now, but may help with the general understanding:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you make a typo in the field names, avro will just ignore the actions of the right field and instead process the new field, which will be empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is technically quite a different problem than when you actually make a typo in the Type, as those are possible to check against the list of possible types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So detection of typos in field names is hard, and despite what the name suggests it seems LogicalType is actually a field name from Nifi perspective.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 14:08:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Timestamp-Format-Issue-NiFi-s-PutDatabaseRecord/m-p/284769#M211424</guid>
      <dc:creator>DennisJaheruddi</dc:creator>
      <dc:date>2019-12-04T14:08:01Z</dc:date>
    </item>
  </channel>
</rss>

