From 639ab328c9e717e259740133a5571b9ab7123f0d Mon Sep 17 00:00:00 2001 From: Matthew Burgess Date: Wed, 25 May 2022 16:21:40 -0400 Subject: [PATCH] NIFI-10057: Add support for SQL Server's DATETIMEOFFSET type to ExecuteSQL processors Signed-off-by: Pierre Villard This closes #6080. --- .../org/apache/nifi/serialization/record/ResultSetRecordSet.java | 1 + .../src/main/java/org/apache/nifi/util/db/JdbcCommon.java | 1 + 2 files changed, 2 insertions(+) diff --git a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java index 8ce2255ab2..d2c4f6cb09 100644 --- a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java +++ b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java @@ -526,6 +526,7 @@ public class ResultSetRecordSet implements RecordSet, Closeable { case Types.TIMESTAMP_WITH_TIMEZONE: case -101: // Oracle's TIMESTAMP WITH TIME ZONE case -102: // Oracle's TIMESTAMP WITH LOCAL TIME ZONE + case -155: // SQL Server's DATETIMEOFFSET return getRecordFieldType(TIMESTAMP, useLogicalTypes); } diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java b/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java index 30e6c51c68..b78408c912 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java @@ -635,6 +635,7 @@ public class JdbcCommon { case TIMESTAMP_WITH_TIMEZONE: case -101: // Oracle's TIMESTAMP WITH TIME ZONE case -102: // Oracle's TIMESTAMP WITH LOCAL TIME ZONE + case -155: // SQL Server's DATETIMEOFFSET addNullableField(builder, columnName, u -> options.useLogicalTypes ? u.type(LogicalTypes.timestampMillis().addToSchema(SchemaBuilder.builder().longType()))