Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-12313

PutDatabaseRecord Insert datetime without microseconds due to data type conversion

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.23.2
    • None
    • None
    • None
    • Nifi 1.23.2.
      SQL Server 2022

    Description

      We have encountered an issue when migrating from version 1.12.1 to version 1.23.2, which is related to the change associated with this issue:
      "NIFI-8223 - PutDatabaseRecord should use table column datatype instead of field datatype." 
      This issue introduced a change in the data transformation logic in the PutDatabaseRecord processor, which converts a field (e.g., of type string) to the data type of its corresponding database column.

      This is causing problems because our field in the database is of type datetime2 and our string is "2023-10-19 14:14:59.999314" However, the processor is converting it to "2023-10-19 14:14:59" without microseconds, despite setting the format in the csvreader.

      To address this, we have made an adjustment in the PutDatabaseRecord processor so that users at the processor level can choose whether to apply the transformation to the database column type or maintain the Nifi format.

      Attachments

        1. database.png
          108 kB
          Anibal Vasquez
        2. flowfile.png
          97 kB
          Anibal Vasquez
        3. nifi_flow.png
          91 kB
          Anibal Vasquez

        Issue Links

          Activity

            People

              Unassigned Unassigned
              avasquez Anibal Vasquez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h